Git Product home page Git Product logo

pict's Introduction

Pairwise Independent Combinatorial Testing

PICT generates test cases and test configurations. With PICT, you can generate tests that are more effective than manually generated tests and in a fraction of the time required by hands-on test case design.

PICT runs as a command line tool. Prepare a model file detailing the parameters of the interface (or set of configurations, or data) you want to test. PICT generates a compact set of parameter value choices that represent the test cases you should use to get comprehensive combinatorial coverage of your parameters.

For instance, if you wish to create a test suite for partition and volume creation, the domain can be described by the following parameters: Type, Size, File system, Format method, Cluster size, and Compression. Each parameter has a limited number of possible values, each of which is determined by its nature (for example, Compression can only be On or Off) or by the equivalence partitioning (such as Size).

Type:          Single, Span, Stripe, Mirror, RAID-5
Size:          10, 100, 500, 1000, 5000, 10000, 40000
Format method: Quick, Slow
File system:   FAT, FAT32, NTFS
Cluster size:  512, 1024, 2048, 4096, 8192, 16384, 32768, 65536
Compression:   On, Off

There are thousands of possible combinations of these values. It would be difficult to test all of them in a reasonable amount of time. Instead, we settle on testing all possible pairs of values. For example, {Single, FAT} is one pair, {10, Slow} is another; one test case can cover many pairs. Research shows that testing all pairs is an effective alternative to exhaustive testing and much less costly. It will provide very good coverage and the number of test cases will remain manageable.

More information

See doc/pict.md for detailed documentation on PICT and http://pairwise.org has details on this testing methododology.

The most recent pict.exe is available at https://github.com/microsoft/pict/releases/.

Contributing

PICT consists of the following projects:

  • api: The core combinatorial engine,
  • cli: PICT.EXE command-line tool,
  • clidll: PICT.EXE client repackaged as a Windows DLL to be used in-proc,
  • api-usage: A sample of how the engine API can be used,
  • clidll-usage: A sample of how the PICT DLL is to be used.

Building and testing on Windows with MsBuild

Use pict.sln to open the solution in Visual Studio 2022. You will need VC++ build tools installed. See https://www.visualstudio.com/downloads/ for details.

PICT uses MsBuild for building. _build.cmd script in the root directory will build both Debug and Release from the command-line.

The test folder contains all that is necessary to test PICT. You need Perl to run the tests. _test.cmd is the script that does it all.

The test script produces a log: dbg.log or rel.log for the Debug and Release bits respectively. Compare them with their committed baselines and make sure all the differences can be explained.

There are tests which randomize output which typically make it different on each run. These results should be masked in the baseline but currently aren't.

Building on Linux, OS/X, *BSD, etc.

PICT uses CMake to build on Linux. Assuming installation of CMake and C++ toolchain, following set of commands will build and run tests in the directory build

> cmake -DCMAKE_BUILD_TYPE=Release -S . -B build
> cmake --build build
> pushd build && ctest -v && popd

Debugging

Most commonly, you will want to debug the command-line tool. Start in the pictcli project, cli/pict.cpp file. You'll find wmain routine there which would be a convenient place to put the very first breakpoint.

PICT as a container

To build a container image with PICT, just execute

make image-build

Once built, you can run it with a sample model as follows

make image-run

To use your own models, please execute

podman run -it --rm -v ./<local-dir>:/var/pict:Z pict:latest <your-model-file> [<pict-options>]

pict's People

Contributors

apodhrad avatar apteryks avatar bhardwajs avatar clebergnu avatar dan-tripp avatar happy2discover avatar jaccz avatar justinjschaub avatar kmaehashi avatar microsoft-github-policy-service[bot] avatar msftgits avatar nullpo-head avatar orip avatar patricevignola avatar pihentagy avatar pokrakam avatar qykth-git avatar rneatherway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pict's Issues

no v3.7.2 release tag

Hello,

It seems the 3.7.2 release was tagged as just 'release' ? Is there a reason for it? Otherwise I'd suggest to tag a v3.7.2 as the logical successor of v3.7.1 :-).

Thank you!

Support for clang using -Wall

While experimenting with CMake build for PICT, I used -Wall -Werror with clang-12. The build failed. Would you be interested in fixes to those warnings?

[feature request] convenient option to output all combinations

Hi!

While I understand that the merit of this tool is to enable greatly reducing the amount of combinations to test while maintaining a good coverage, I think it'd be nice to have a robust way to invoke the tool to generate all combinations without having to rely on crude hacks such as pict models.pict /o:$(wc -l models.pict | cut -f1 -d' ') :-).

One idea would be to support '/o:max' as a shortcut to test the greatest order possible.

Thank you!

CMake build system for PICT?

I was looking at ingesting PICT using a vcpkg port. The best route for that would be to have a CMake build pipeline for PICT. Would there be an interest if I send a PR to switch Linux build to CMake? This would enable me to consume PICT for Windows using CMake too.

Marking values as negative depending on constraint

I find my self writing models with variables with possible values that can be positive or negative depending on the value of another variable. In Example1 the value "c2" is negative if [A]="a2". To deal with this I duplicate the value "c2" and add a constraint as shown.
Is there a better way to deal with this, that doesn't involve duplicating "c2" like that? If not, would you consider adding syntax for this like Example2?

Example1

A: a1, a2
B: b1, b2
C: c1, c2_positive, ~c2_negative
IF [A] = "a2" THEN
    [C] <> "c2_positive"
ELSE
    [C] <> "c2_negative";

Example2 - not supported!

A: a1, a2
B: b1, b2
C: c1, c2
IF [A] = "a2" THEN
    NEGATIVE([C] = "c2")

High CPU load and hang of the PICT process after utf8 input on Linux

After run with UTF-8 encoded file with Russian characters (attached) it just doesn't nothing instead of a high CPU load.
OS: Ubuntu 16.04.3

$ ./pict u8_rus.txt
...
$ top -p `pidof pict`

PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                                                                                                           
32743 bhrigu    20   0   13888   1652   1508 R 99,9  0,0  44:50.41 pict
...

(gdb) attach 32743
...
(gdb) bt
#0  0x000000000046452c in std::unary_negate<std::pointer_to_unary_function<unsigned int, int> > std::not1<std::pointer_to_unary_function<unsigned int, int> >(std::pointer_to_unary_function<unsigned int, int> const&) ()
#1  0x00000000004638a6 in trim(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >) ()
#2  0x000000000046363d in lineIsEmpty(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&) ()
#3  0x000000000045d459 in CModelData::readModel(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) ()
#4  0x000000000045d7d5 in CModelData::ReadModel(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) ()
#5  0x00000000004621ed in execute(int, wchar_t**, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&) ()
#6  0x00000000004625cf in wmain(int, wchar_t**) ()
#7  0x0000000000462781 in main ()

u8_rus.txt

Feature suggestion: Add arithmetic operations to constraints

As a user I would like to use arithmetic operations on parameters in a constraint to further increase the possibility to create test cases alongside more complex business logic.

e.G. in case of the insurance domain:
IF [AmountFireDamages] + [AmountPipeWaterDamages] > 5 THEN [Coverage] = "Basic Coverage" ELSE "Extended Coverage";

I tried to fit it into the constraints grammar by adding it in the term and introducing the new ArithmeticOperation (only valid for Numerical Parameters):

Term          :: =
  ParameterName Relation Value
| ParameterName LIKE PatternString
| ParameterName IN { ValueSet }
| ParameterName Relation ParameterName
| ParameterName ArithmeticOperation ParameterName

ArithmeticOperation :: = 
  + 
| - 
| *
| /

As I'm not deep enough into C++ coding, I unfortunately couldn't add a pull request for now, in case this is needed, I would actually try to come up with something, but this could take some time.
In case needed I would be happy to get a hint where I would need to change some things. From a first screening I would have guessed somewhere in generator.h and exclusion.cpp?

Japanes Kanji "予" would be cause of exception in if expression

Description

The kanji that commonly used "予" would be cause of exception like:

  • When: Use "予" as a condition: Input Error: Non-special character was escaped (Something like "予定日時" means "Scheduled date")
  • When: Use just only one letter "予" in if expression: Input Error: Misplaced THEN keyword or missing logical operator: if [予] = "Hoge" then [Foo] = "Bar"

Test code:

予:Hoge
Foo:Bar

if [予] = "Hoge" then [Foo] = "Bar"

Saved text file with ANSI encode, by Windows 10's default notepad

Expected Result

No errors and will get output of test cases.

Actual Result

Got error above.

Combinations lost of it

CONTENT OF PICT INPUT FILE(test.txt):
A: a1
B: b1
C: c1,c2
D: d1,d2
E: e1,e2
F: f1,f2
G: g1,g2,g3,g4
H: h1,h2,h3,h4
I: i1,i2,i3,i4,i5

{A,B,C,E,D}@5
{F,G,H,I}@1

if [E] in {"e1"} then [G] in {"g1","g2"} else [G] in {"g3","g4"};
if [D] in {"d1"} then [I] in {"i1","i3"} else [I] in {"i2","i4","i5"};
if [E] in {"e1"} then [H]="h4" else [H]<>"h4";

AFTER GENERATION BY PICT:(command is: pict test.txt /o:1)
A B C D E F G H I
a1 b1 c1 d2 e2 f2 g3 h3 i4
a1 b1 c2 d1 e1 f1 g2 h4 i1
a1 b1 c2 d2 e2 f2 g4 h2 i2
a1 b1 c1 d1 e1 f1 g1 h4 i3
a1 b1 c2 d2 e2 f1 g4 h1 i5

parameters:ABCDE as@5 have 8 combinations and FGHI as@1 have 5 combinations. We predicted that the combinations of the two submodels have at least 8 results. But when we read and research the source codes of PICT we found that some random pick values of FGHI and constraints had confilcted with the 8 values of ABCDE combinations.

But in fact, we DO have some combinations to stay all of the 8 combination of ABCDE, such as:
A B C D E F G H I
1 | a1 | b1 | c1 | d1 | e1 | f2 | g2 | h4 | i1
2 | a1 | b1 | c1 | d2 | e2 | f1 | g3 | h1 | i2
3 | a1 | b1 | c1 | d1 | e2 | f2 | g4 | h2 | i3
4 | a1 | b1 | c1 | d2 | e1 | f1 | g1 | h4 | i4
5 | a1 | b1 | c2 | d2 | e2 | f2 | g3 | h3 | i5
6 | a1 | b1 | c2 | d1 | e1 | f2 | g2 | h4 | i1
7 | a1 | b1 | c2 | d2 | e1 | f1 | g1 | h4 | i5
8 | a1 | b1 | c2 | d1 | e2 | f1 | g3 | h1 | i3

So in this situation, do we have some method to fix it still using PICT? Do we have other method to generate them? Or we must change the source code of PICT to generate them?

Can we exclude redundant parameters for some scenarios

Is there a way to exclude value-dependent parameters for some test cases?
For example if P1 below is negative then P2 and P3 are irrelevant.

P1: -1, 0, 1
P2: A, B, C
P3: X, Y, Z

Here PICT will generate 4 scenarios involving P2 and P3 where P1 is -1. However the use case is that -1 makes P2 and P3 irrelevant, thus I only need one test.

Now I can specify a constraint to associate -1 with A&X, but as I understand it this will 'use up' a P2/P3 combination that I want to test in other constellations.

For the simple case where only one additional parameter is redundant, I've worked out a hack to achieve the right effect by adding a blank dummy value and making the two mutually constrained, but it won't work for two or more redundant parameters.

Example:

P1: -1, 0, 1
P2: A, B, C

will generate

~-1     A
~-1     B
~-1     C

But if I add a comma at the end of P2 and do this:

P1: -1, 0, 1
P2: A, B, C,

IF [P1] = -1 THEN [P2] = "";
IF [P2] = "" THEN [P1] = -1;

I get all the other 0/1 + A/B/C combinations as before and a single -1 test, which is perfect.
But I can't achieve this with two redundant parameters as per my first example. I've played with groups, but couldn't get the desired result.
Is this possible with PICT?
By the way huge thanks for an excellent tool!

pict 中文testcase.txt error

您好,使用pict生成测试用例时,文件名是中文的,会提示错误:Input Error: Couldn't open file

Hello, when using pict to generate test cases, the file name is in Chinese and an error will be prompted: Input Error: Couldn't open file

OS Version: Windows10 x64
pict Version: 3.7.2

示例文件: 在附件中
Sample file: in attachment
test批量打印快递单.txt

Add support for collections

I'd like to be able to use parameters that are lists or sets.

Today I can do something like the following:

PLATFORM:   x86, ia64, amd64
CPUS:       Single, Dual, Quad
RAM:        128MB, 1GB, 4GB, 64GB
HDD:        SCSI, IDE
OS:         NT4, Win2K, WinXP, Win2K3
IE:         4.0, 5.0, 5.5, 6.0
APPS_size:  0, 1, 2
APPS_0:     n/a, SQLServer, Exchange, Office
APPS_1:     n/a, SQLServer, Exchange, Office

IF [APPS_size] = 0 THEN [APPS_0] = "n/a" AND [APPS_1] = "n/a";
IF [APPS_size] = 1 THEN [APPS_0] <> "n/a" AND [APPS_1] = "n/a";
IF [APPS_size] = 2 THEN [APPS_0] <> "n/a" AND [APPS_1] <> "n/a" AND [APPS_0] <> [APPS_1];

I'd like to be able to write something more succinct though. e.g.:

PLATFORM:   x86, ia64, amd64
CPUS:       Single, Dual, Quad
RAM:        128MB, 1GB, 4GB, 64GB
HDD:        SCSI, IDE
OS:         NT4, Win2K, WinXP, Win2K3
IE:         4.0, 5.0, 5.5, 6.0
APPS (Set): 0..2 of { SQLServer, Exchange, Office }

For a list the above example would not have [APPS_0] <> [APPS_1] and would have APPS (List) instead of APPS (Set) (or some similar grammar).

Revisit list of available tools

A Question regarding capability of the tool

Hi, I'm trying to understand if the tool support this limitation:

item a : 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
item b: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
item c: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
more...

Can I create a rule that item a + item b + item c must always be 100, calculate the numbers of each item for example my results should be:
item a = 10
item b = 40
item c = 50

in any given option the total should be 100

Nati

Output as JSON

Hi, I'd like to humbly request a switch to toggle json output format instead of table-based.

e.g.

[/] $ pict model /json
[
  {
    "OS": "Win7",
    "Model": "Home"
  },
  {
    "OS": "Win10",
    "Model": "Pro"
  }
]

Wrong test case generated

-- The parameter settings--
comp_unit: 1,2,3
block_min_q: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
IF [comp_unit] = 2 AND [x1p2_mode] = 0 THEN [block_min_q] < 12;
x1p2_mode: 0,1

-- The test case generated--
comp_unit x1p2_mode block_min_q
2 0 12
2 0 13

The question:
I think these test case should not be generated with above parameters and conditions.
But they appeared in the output. Since I am not very famillar with this tool. May be there were some mistake in my input file(the parametes and conditions).

Illegal combination given when o:1 set

Hi Jacek,

I seem to be getting an illegal output but only when I've got the order set to 1 (version 3.3.8.0).

Here is my model file:
CCC: H, L
A0: 0,1
A1: 0,1
B0: 0,1
B1: 0,1
L0: 0,1
L1: 0,1
BIG: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32

IF [CCC] IN {"H"} THEN
([A0] = 1 OR [A1] = 1) AND ([B0] = 1 OR [B1] = 1);

IF [CCC] IN {"L"} THEN
[L0] = 1 OR
[L1] = 1;

If I run with /o:1 then I end up with cases where "CCC" is "H" and both A0 and A1 are 0.

If I run with /o:2 or above I don't get this issue.

I thought I'd let you know in case there is a bug in the tool or incase I'm doing something wrong.

Missing Negative Cases When Using Submodels

I found some weird situations in which all negative values of one submodel are ignored without any warning or error. This is the smallest model I found where this happens:

C1: 1, ~0
C2: 1, 2, 3, ~0

D1: ok, ~fail
D2: 1, ~0, ~-1
D3: 1, ~0, ~-1, ~-2, ~-3

{C1, C2} @ 2
{D1, D2, D3} @ 2

Current Behavior:

pict model /r:1222

C1      C2      D1      D2      D3
1       1       ok      1       1
1       3       ok      1       1
1       2       ok      1       1
1       1       ok      ~-1     1
1       2       ok      1       ~-3
1       1       ~fail   1       1
1       3       ok      1       ~-1
1       3       ok      ~0      1
1       2       ok      ~-1     1
1       2       ok      1       ~0
1       2       ok      ~0      1
1       3       ok      1       ~0
1       3       ok      ~-1     1
1       1       ok      ~0      1
1       1       ok      1       ~-3
1       2       ok      1       ~-1
1       3       ok      1       ~-3
1       1       ok      1       ~0
1       3       ~fail   1       1
1       1       ok      1       ~-1
1       1       ok      1       ~-2
1       2       ok      1       ~-2
1       3       ok      1       ~-2
1       2       ~fail   1       1

Expected Behavior:

  • Expected test cases with C1=~0
  • Expected test cases with C2=~0

Constraints Warning: All or no values satisfy relation

Hello,

I wonder how to deal with this warning when I got this warning. For example :

someString: null, "", "$", "\$", "foo"

I would like to do something like that :

IF NOT ( [someString] in {foo} ) THEN ....

Thanks for your help

Build failure on NetBSD

$ make 
clang++ -std=c++11 -Iapi -w api/*cpp cli/*cpp -o pict
cli/mparser.cpp:444:11: error: call to implicitly-deleted copy constructor of 'wifstream' (aka 'basic_ifstream<wchar_t>')
    return( file );
          ^~~~~~~~
/usr/include/g++/fstream:427:28: note: copy constructor of 'basic_ifstream<wchar_t, std::char_traits<wchar_t> >' is implicitly deleted because base class
      'basic_istream<wchar_t, std::char_traits<wchar_t> >' has a deleted copy constructor
    class basic_ifstream : public basic_istream<_CharT, _Traits>
                           ^
/usr/include/g++/istream:58:27: note: copy constructor of 'basic_istream<wchar_t, std::char_traits<wchar_t> >' is implicitly deleted because base class
      'basic_ios<wchar_t, std::char_traits<wchar_t> >' has a deleted copy constructor
    class basic_istream : virtual public basic_ios<_CharT, _Traits>
                          ^
/usr/include/g++/bits/basic_ios.h:66:23: note: copy constructor of 'basic_ios<wchar_t, std::char_traits<wchar_t> >' is implicitly deleted because base class
      'std::ios_base' has an inaccessible copy constructor
    class basic_ios : public ios_base
                      ^
cli/mparser.cpp:452:15: error: call to implicitly-deleted copy constructor of 'wifstream' (aka 'basic_ifstream<wchar_t>')
    wifstream file = openFile( filePath );
              ^      ~~~~~~~~~~~~~~~~~~~~
/usr/include/g++/fstream:427:28: note: copy constructor of 'basic_ifstream<wchar_t, std::char_traits<wchar_t> >' is implicitly deleted because base class
      'basic_istream<wchar_t, std::char_traits<wchar_t> >' has a deleted copy constructor
    class basic_ifstream : public basic_istream<_CharT, _Traits>
                           ^
/usr/include/g++/istream:58:27: note: copy constructor of 'basic_istream<wchar_t, std::char_traits<wchar_t> >' is implicitly deleted because base class
      'basic_ios<wchar_t, std::char_traits<wchar_t> >' has a deleted copy constructor
    class basic_istream : virtual public basic_ios<_CharT, _Traits>
                          ^
/usr/include/g++/bits/basic_ios.h:66:23: note: copy constructor of 'basic_ios<wchar_t, std::char_traits<wchar_t> >' is implicitly deleted because base class
      'std::ios_base' has an inaccessible copy constructor
    class basic_ios : public ios_base
                      ^
cli/mparser.cpp:546:15: error: call to implicitly-deleted copy constructor of 'wifstream' (aka 'basic_ifstream<wchar_t>')
    wifstream file = openFile( filePath );
              ^      ~~~~~~~~~~~~~~~~~~~~
/usr/include/g++/fstream:427:28: note: copy constructor of 'basic_ifstream<wchar_t, std::char_traits<wchar_t> >' is implicitly deleted because base class
      'basic_istream<wchar_t, std::char_traits<wchar_t> >' has a deleted copy constructor
    class basic_ifstream : public basic_istream<_CharT, _Traits>
                           ^
/usr/include/g++/istream:58:27: note: copy constructor of 'basic_istream<wchar_t, std::char_traits<wchar_t> >' is implicitly deleted because base class
      'basic_ios<wchar_t, std::char_traits<wchar_t> >' has a deleted copy constructor
    class basic_istream : virtual public basic_ios<_CharT, _Traits>
                          ^
/usr/include/g++/bits/basic_ios.h:66:23: note: copy constructor of 'basic_ios<wchar_t, std::char_traits<wchar_t> >' is implicitly deleted because base class
      'std::ios_base' has an inaccessible copy constructor
    class basic_ios : public ios_base
                      ^
3 errors generated.
*** Error code 1

Stop.
make: stopped in /public/pict
$ uname -a
NetBSD chieftec 7.99.26 NetBSD 7.99.26 (GENERIC) #0: Wed Feb 10 21:58:18 UTC 2016  root@chieftec:/tmp/netbsd-tmp/sys/arch/amd64/compile/GENERIC amd64
$ pkg_info |grep -E 'llvm|clang'                                                                                                                    
llvm-3.9.0nb20160213 Low Level Virtual Machine compiler infrastructure
clang-3.9.0nb20160213 C language family frontend for LLVM

Failed to fetch when multiple constraints on one parameter

I found that when a variable has multiple constraints, the processing time goes crazy even add one more value to related parameters. Here is an example:
Let variable [A] can be either 0 or 1, and variables [B] - [I] are dependent parameters. If [A] = 0, then [E] - [H] are not valid so that we set them to "N/A". If [A] = 1, then [I] is not valid. So I write this into the txt for testing:

#define parameters
A: 0,1
B: 0,1,3,6,N/A
C: 128,384,N/A
D: 128,256,384,N/A
E: 128,256,N/A
F: 7,9,N/A
G: 7,11,N/A
H: 0,1,8,N/A
I: 4,8,N/A

#constraints
if [A] = 0 then [B] = "N/A" else [B] <> "N/A";
if [A] = 0 then [C] = "N/A" else [C] <> "N/A";
if [A] = 0 then [D] = "N/A" else [D] <> "N/A";
if [A] = 0 then [E] = "N/A" else [E] <> "N/A";
if [A] = 0 then [F] = "N/A" else [F] <> "N/A";
if [A] = 0 then [G] = "N/A" else [G] <> "N/A";
if [A] = 0 then [H] = "N/A" else [H] <> "N/A";

if [A] = 1 then [I] = "N/A" else [I] <> "N/A";

If we test above text, it will show failed to fetch on web or simply stuck in Terminal. However, if we decrease the number of values of all parameters to 2 or 3, then it worked[Say I will delete 384 for parameter D]. It seems that constraints can cause exponential increasing processing time.

`make test` failing in Ubuntu 18.04

I have tried to build the project in Ubuntu 18.04

After sudo apt-get install build-essential clang, make all test returns some testing errors (compilation is clean).

I would appreciate if someone could take a look at the failures. I find it hard to read the failing results, and C++ is not my strongest suit. It could be that one of the failing test cases had UTF-8 test (the input data looked weird when opening the file with nano)

Kindly inform me what should I upload.

───────┬─────────────────────────────────────────────
       │ File: test/rel.log.failures
───────┼─────────────────────────────────────────────
   1   │ EXP: 4 ACT: 134    /                    /v
   2   │ EXP: 4 ACT: 134    //                   /v
   3   │ EXP: 0 ACT: 2    bug020.txt /d:`      /v
   4   │ EXP: 0 ACT: 134    enc003.txt    /v
   5   │ EXP: 4 ACT: 134    enc001.txt    /v
   6   │ EXP: 4 ACT: 134    enc002.txt    /v
   7   │ EXP: 0 ACT: 134    real037.txt    /v
───────┴─────────────────────────────────────────────

Support range(start, end, step) function

I'd like to humbly request a python-like range function that takes a start, end, and step function to generate values so I don't have to type out 1, 2, 3, 4, 5, 6, ...100.

e.g.
range(1, 3, +1) => 1, 2, 3
range(1.0, 3.0, +1.0) => 1.0, 2.0, 3.0
range(2, 32, **2) => 2, 4, 8, 16, 32

Negative value dont work when constraint order 1?

Hi,

First of all, thank you for this nice tool!

I'm using PICt for few days and I try toi use negative value (use a "~")
I'm not a developer so I just status on an output I obtained and which seems strange.

Considering in a file.txt the following parameters:

Param: param1, ~param2
Value: value1, value2, value3, value4

I tryed to generate output from order 1 and order 2:

image

I understand the output using order 2
=> I force the exhaustif combinatory among all parameters

I DON'T understand the output using order 1
=> I expected only one value associated to "~param2" because it is combined to one "positive value". This is not relevant to test the "~param2" with other "positive" value in case of order 1.

Thank you in advance for your answer / correction, it would help a lot.

Regards

Nuget package submission?

Our team is using PICT for a new project, but we don't see this Nuget package being published on nuget.org. Is there a plan to publish the package using the nuspec already present in the repo?

Endless calculation with following model

Using the following model PICT runs in an endless loop.

Only if I comment the last block the model runs through but the result is not correct.
I’m using pict.exe with a version of November 10th 2005. Currently I have not the right infrastructure for compiling and debugging the code from here.
Could you please help me how to get around this problem?

Model

Eingangskanal: EVA_Anlageberatung, EVA_Order, EVA_Sonderweg, EVA_Sparplan, EVA_Neuemission, EVA_Direkteinstieg, HOST_T19000, HOST_T19001, HOST_T19901, HOST_T19750, HOST_T28900, Onlinebanking_PC, Onlinebanking_MSB, Onlinebanking_Neuemission_PC, Onlinebanking_Neuemission_MSB, Onlinebanking_Tablet_PC, Infobroker, commerzbank_de_pib
Finanzinstrument: Aktie, Unstrukturierte_Anleihe, strukturierte_Anleihe, Inv.Fonds, OIF, Zertifikat, Optionsschein, Xetra_Gold_ETC, EMISID
Produktzyklus: Neuemission_Information, Neuemission_offen, Neuemission_geschlossen, Neuemission_abgerechnet, Sekundaermarkt, n/a
Dienstleistungsart: Anlageberatung, beratungsfreies_Geschaeft, n/a
Orderart: Kauf
(Beratungsdatum_gueltig), Kauf_(ohne_Beratungsdatum), Verkauf, aenderung, Streichung, Storno, Berichtigungsauftrag, n/a
Initiator: Kunde, Bank, n/a
Auftragserteilung: telefonisch, persoenlich, schriftlich, Haustuergeschaeft, n/a
Bereitstellungsdokumente: Beratungsprotokoll_Kunde, Beratungsprotokoll_Interessent, Beratungsprotokoll_Potenzial, Nachtraeglicher_KID-Versand, n/a
UDAL-Status: Normalbetrieb, Back_up-Betrieb, PRIIP,ohne_KID, WKN_nicht_vorhanden, WKN_inaktiv/geloescht, defektes_Dokument, Virus, non-PRIIP_auf_Blackliste, PRIIP_auf_Blackliste, UDAL_nicht_verfuegbar, n/a
Abruf_Infoblaetter: WA_von_FWW, PIB_von_DOTi, PIB_von_C&M-FIC, PIB_von_PC_PM, KID_von_PC_PM, KID_von_DOTi, KID_von_externem_Hersteller

IF [Eingangskanal] = "HOST_T19901"
THEN [Orderart] <> "Kauf_(Beratungsdatum_gueltig)"
AND [Produktzyklus] <> "Neuemission_offen"
AND [Produktzyklus] <> "n/a"
AND [Dienstleistungsart] <> "n/a"
AND [Orderart] <> "n/a"
AND [Initiator] = "n/a"
AND [Auftragserteilung] = "n/a"
AND [Bereitstellungsdokumente]= "n/a"
AND [UDAL-Status] = "n/a";

IF [Eingangskanal] in {"HOST_T19000", "HOST_T19001", "HOST_T19750", "HOST_T28900"}
THEN [Produktzyklus] <> "Neuemission_Information"
AND [Produktzyklus] <> "Neuemission_offen"
AND [Produktzyklus] <> "n/a"
AND [Dienstleistungsart] <> "n/a"
AND [Orderart] <> "n/a"
AND [Initiator] = "n/a"
AND [Auftragserteilung] = "n/a"
AND [Bereitstellungsdokumente]= "n/a"
AND [UDAL-Status] = "n/a";

IF [Eingangskanal] like "EVA_*"
THEN [Initiator] <> "n/a"
AND [Produktzyklus] <> "n/a"
AND [Dienstleistungsart] <> "n/a"
AND [Orderart] <> "n/a"
AND [Auftragserteilung] <> "n/a"
AND [Bereitstellungsdokumente] <> "n/a"
AND [UDAL-Status] <> "n/a";

IF [Eingangskanal] IN {"Onlinebanking_PC", "Onlinebanking_MSB", "Onlinebanking_Tablet_PC"}
THEN [Produktzyklus] <> "Neuemission_Information"
AND [Produktzyklus] <> "Neuemission_offen"
AND [Produktzyklus] <> "n/a"
AND [Dienstleistungsart] <> "n/a"
AND [Orderart] <> "n/a";

IF [Eingangskanal] like "Onlinebanking*"
THEN [Dienstleistungsart]="beratungsfreies_Geschaeft"
AND [Produktzyklus] <> "n/a"
AND [Dienstleistungsart] <> "n/a"
AND [Orderart] <> "Storno"
AND [Orderart] <> "Berichtigungsauftrag"
AND [Orderart] <> "Kauf_(Beratungsdatum_gueltig)"
AND [Orderart] <> "n/a"
AND [Initiator] = "n/a"
AND [Auftragserteilung] = "n/a"
AND [Bereitstellungsdokumente] = "n/a"
AND [UDAL-Status] <>"Back_up-Betrieb";

IF [Eingangskanal] IN {"EVA_Sonderweg", "EVA_Sparplan", "EVA_Direkteinstieg", "EVA Order"}
THEN [Produktzyklus] <>"Neuemission_Information"
AND [Produktzyklus] <>"Neuemission_offen"
AND [Produktzyklus] <>"n/a"
AND [Dienstleistungsart] <>"n/a"
AND [Orderart] <>"n/a";

IF [Eingangskanal] IN {"EVA_Sonderweg", "EVA_Sparplan", "EVA_Direkteinstieg"}
THEN [Orderart] <>"Storno"
AND [Orderart] <>"Berichtigungsauftrag"
AND [Orderart] <>"Kauf_(Beratungsdatum_gueltig)"
AND [Produktzyklus] <>"n/a"
AND [Dienstleistungsart] <>"n/a"
AND [Orderart] <>"n/a";

IF [Eingangskanal] in {"EVA_Anlageberatung", "EVA_Neuemission", "EVA_Order"}
THEN [Orderart] <>"Storno"
AND [Orderart] <>"Berichtigungsauftrag"
AND [Produktzyklus] <>"n/a"
AND [Dienstleistungsart] <>"n/a"
AND [Orderart] <>"n/a";

IF [Eingangskanal] IN {"Infobroker", "commerzbank_de_pib"}
THEN [Finanzinstrument] <> "EMISID"
AND [Produktzyklus] = "n/a"
AND [Dienstleistungsart] = "n/a"
AND [Orderart] = "n/a"
AND [Initiator] = "n/a"
AND [Auftragserteilung] = "n/a"
AND [Bereitstellungsdokumente]= "n/a"
AND [UDAL-Status] <> "Back_up-Betrieb";

Bad performance with many constraints.

  • 22 parameters, each have 2-9 values.

  • 9 constraints, including 8 like"IF THEN ELSE" and 1 like [a]<=[b] and 2 of the 'IF THEN ELSE' constraints are big like:

IF [sysbench] in {"oltp_read_only.lua",  "oltp_read_write.lua"} THEN 
	[--range-size] >= 0 AND
	[--point-selects] >= 0 AND
	[--simple-ranges] >= 0 AND
	[--sum-ranges] >= 0 AND
	[--order-ranges] >= 0 AND
	[--distinct-ranges] >= 0 AND
	[--range-selects] <> "nil"
 ELSE 
	[--range-size] = -1 AND
	[--point-selects] = -1 AND
	[--simple-ranges] = -1 AND
	[--sum-ranges] = -1 AND
	[--order-ranges] = -1 AND
	[--distinct-ranges] = -1 AND
	[--range-selects] = "nil";
  • Then I run with default configurations, the program hangs. I wait about 30min but nothing happens.

  • if I reduce the constraints, e.g., remove one of the 'big' IF THEN ELSE, run with default configurations, it just takes about 10-20 sec.

Does the order of constraints matters? Or the algorithm is just exponential?

Please help
Thank you.

Fails if all constraints are in form NOT(...)

If I use this model:

A1 : V0, V1, V2, V3
A2 : T, F

NOT (([A1]="V0") AND ([A2]="T"));
NOT (([A1]="V1") AND ([A2]="F"));

It fails with the following message:
Input Error: Parameter NOT (([A1]="V0") AND ([A2]="T")); should have at least one value defined

If I simply change the first logical constraint in this equivalent form:
(([A1]<>"V0") OR ([A2]<>"T"));
everything works, and it gives the right output

This happens whenever all the constraints are in form NOT(...). If there is at least one constraint not in negative form it works.

Pict run on Linux has a problem

When using files in the UTF-8 encoding format,there is a error:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

When using [nkf -e] to change the encoding format to EUC-JP,the problem also appear.
The files have japanese characters.

Pict command not found

I clone this source code and after that using make command, file pict already create but i can using this.

Add pre-existing cases

In our case some test configurations may be costly to setup. And we would prefer, to feed available configurations to PICT. And then have PICT determine what are the missing configurations if any. I know this is a complex request. but it would be very useful. Perhaps any recommendations?

Silently crush with massive combination model

env : Windows 10 Pro with 16GB RAM

input.txt

param1: 0, 1, 2, 3, 4, 5, 6, 7, 8, ..., 98, 99
param2: 0, 1, 2, 3, 4, 5, 6, 7, 8, ..., 98, 99
param3: 0, 1, 2, 3, 4, 5, 6, 7, 8, ..., 98, 99
param4: 0, 1, 2, 3, 4, 5, 6, 7, 8, ..., 98, 99
param5: 0, 1, 2, 3, 4, 5, 6, 7, 8, ..., 98, 99
param6: 0, 1, 2, 3, 4, 5, 6, 7, 8, ..., 98, 99
param7: 0, 1, 2, 3, 4, 5, 6, 7, 8, ..., 98, 99
  • case1
    pict.exe input.txt /o:4
    So in this situation, memory usage increases only for a moment and exit silently.

  • case2
    pict_debug.exe input.txt /o:4
    When use self compiled exe with debug mode, the following was displayed.

    MicroSoft Visual C++ Runtime Library
    
    Debug Error!
    Program:.../pict_debug.exe
    
    abort() has been called
    

Is there any solution?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.