PathCrawler C++

AttachmentSize
correct.pdf130.33 KB
manual.pdf217.09 KB
Overview of the solution: 

PathCrawler is a prototype tool for the automatic generation of unit test-case inputs for C or C++ functions

Co-Design Challenges Addressed: 

Tests built by hand and based on the requirements may not be sufficient for testing the embedded software of a hardware/software system. Indeed, although these tests usually incorporate considerable knowledge and understanding of the system, a human being may overlook some causes of failure. In some cases, the construction by hand of tests based on requirements is too complicated or time-consuming and no testing at all is carried out.

Additional Information: 

PathCrawler provides a solution which brings a certain assurance because it respects a well defined coverage criterion: all-paths. As PathCrawler is automatic, it can reduce the time and effort required for testing and enable a far larger number of tests to be performed.

PathCrawler automatically generates test-cases which cover all the execution paths of a function coded in the C or C++ language. It can be used as a complement to requirements-based testing, to ensure the activation of all possible behaviours of the function or as a relatively quick and easy way to generate tests in the cases where requirements-based testing is too onerous.

PathCrawler does not use the specification or requirements of the function under test. The user only has to provide a definition of the context in which it is to be tested. This is the same as the context in which it will be used in the software/hardware system, unless the function's robustness to unusual inputs must also be tested. This context must be defined in order to ensure that any unexpected behaviour revealed by the tests could really arise. The definition of the context takes the form of ranges of possible values for each input variable and input data-structure field, ranges of possible values for each variable dimension of an input data-structure and any other relations that input values must respect (such as the fact that an input array must be sorted). The user defines these relations by coding a C or C++ function which rejects invalid input values.

PathCrawler is only suitable for unit testing for the following two reasons:
1) Because the number of paths in even relatively small code modules can be very high. PathCrawler can automatically generate the test-cases which cover all the paths, and if these tests can then be automatically executed on the target platform then large numbers of paths can be
tested very rapidly. However, if the number of paths is too large for even automated testing to be feasible, the criteria can be relaxed, for
exemple by only covering paths with a small number of iterations of certain loops, or by covering all branches in the source code instead
of all paths.
2) Because PathCrawler can only treat ANSI C or C++. This means sequential code modules, not multi-threaded code, interruptions, etc. It cannot treat C or C++ programs incorporating  instructions in assembler. It cannot treat function calls unless the source code of the called function is provided.

PathCrawler generates test inputs but the user must decide whether the test results are correct or not, either by manual inspection of the test results or by providing an executable "oracle" program, which can be integrated with PathCrawler to check the results of tests run on the host machine during the test-case generation process.