Top Banner
Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun
22

Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Dec 28, 2015

Download

Documents

Shanon Summers
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Class SpecificationImplementation GraphBy: Njume NjinimbamChi-Chang Sun

Page 2: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

White Box testing

•A software testing technique whereby explicit knowledge of the internal workings of the item being tested are used to select the test data. White box testing uses specific knowledge of programming code to examine outputs

Page 3: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

White Box testing

•Control flow testing•Data flow testing•Branch testing•Path testing•Statement coverage•Decision coverage

Page 4: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Black Box testing

•Black-box testing is a method of software testing that tests the functionality of an application as opposed to its internal structures or workings (see white-box testing). This method of test can be applied to all levels of software testing: unit, integration, system and acceptance. It typically comprises most if not all testing at higher levels, but can also dominate unit testing as well.

Page 5: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Black Box testing

•Decision table testing•All-pairs testing•State transition tables•Equivalence partitioning•Boundary value analysis•Control flow testing

Page 6: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Adjective

•Sufficient testing requires both black- and white-box techniques. Although both tasks are similar in that they have the same objective, namely detecting faults within a program, often black- and white-box techniques are applied separately using different tools. The reason for this is the lack of techniques and tools integrating both tasks.

Page 7: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Object-oriented prototypes VS CSIG

•Both approach relies on a graphical representation combining both specification and implementation of the class under test. Especially in control flow graph of the implementation by special data flow edges.

•However, the major different is that CSIG can construction process can be automated.

Page 8: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Benefits

•1. The tester has only to be familiar with the concepts underlying one technique and needs training only for one tool.

•2. Less maintenance effort is required, since only one tool has to be maintained.

•3. Testing can be carried out more efficiently, since an integrated technique can generate test cases covering both the specification and the source code at the same time.

Page 9: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

CSIG demonstration Edges

• Intra- metho control and data flow edges

•Inter-method control and data flow edges

•CCFG frame edges

Page 10: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Step 1: Generating method implementation graphs•The first step consists of generating a

control flow graph for each method based on its implementation. A control flow graph consists of nodes, representing statements, and edges, representing control flow among the statements. Moreover, the generated control flow graph can be augmented with data flow information for data flow testing.

Page 11: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Step 2: Generating a prototype for each specified method

Page 12: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.
Page 13: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Prototype of a transition

•if (source)• if (guard)• action;• else throw new

ErrorStateException();•else throw new ErrorStateException();

Page 14: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Combine

Page 15: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

CSIG construction cont'd

•step 3- Generating method specification graphs

•Step 4- Generating a CCFG frame•Step 5- Inserting the method graphs into

a CCFG frame•Step 6- Adding data flow edges for black-

box testing▫The identification of def-use pairs for black-

box testing can be carried out in 9 steps

Page 16: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Tool support - Sample test process cont’d

Page 17: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Tool support - Using CSIGs for regression testing•Objective - provide confidence that

modifications have the intended effect and do not affect other unchanged parts of the program.

•selective regression testing - select those test cases from a given test suite covering changed parts of the program

Page 18: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Tool support - Using CSIGs for regression testing cont’d•selective regression testing technique

proposed by Rothermel et al. [21]▫main idea - compare two versions of a class

and analyze the changes between these versions

• In the original approach, class control flow graphs(CCFG) are used to compare the two version. ▫CCFG does not consider specification changes,

we have adjusted their selection algorithm to be applicable to CSIGs

Page 19: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Tool support - Sample test process1. Enter the specification of the class to be tested2. Generation of executable test oracles3. CSIG of the class is generated4. User enters test cases needed for testing first version of the class. 5.Entered test cases are executed and results are compared to those obtained by the test oracle.•The tool also determines adequacy of the

entered test cases

Page 20: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Tool support - Sample test process cont’d6. Two modifications are made to the class.•first modification concerns its

implementation•other modification concerns the

specification7. An executable test oracle and the CSIG are generated8. The two CSIGs are compared using the modified selection algorithm9. The test cases selected are executed.

Page 21: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.
Page 22: Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.

Conclusions

•Contrary to existing representation of classes, a CSIG is not restricted to the specification or implementation of a class.