Software Slicing & Testing
Taegeon Lee
t76lee@uwaterloo.ca
Advisor: Prof. Doo-Hwan Bae
bae@se.kaist.ac.kr
Teaching Assistant: Jiyoung Song
jysong@se.kaist.ac.kr
Slicing
• AnOverview ofProgramingSlicing
• Static andDynamicSlicingComparison
• ProgramDependenceGraph
2/14
Slicing
Introduction Background Overall Approach Methodology Experiments Results Conclusion Discussion
 Programslicingis atechniquefor simplifyingprogramsby focusing on
selectedaspectsof semantics.
 Static,dynamic,conditioned,andamorphous slicingare mainforms of slice.
 Staticslicing
Constructedbydeleting irrelevant partsoftheprogram
Nothingaboutinput
Program dependencegraph canbeused
 Dynamicslicing
Constructaslicewhichexploitedtheinformationavailable abouttheinputwhichcaused
theprogramtogowrong
 There are manyapplicationssuch as debugging,cohesion measurement,
comprehension,maintenance andso on.
3/14Software Slicing & Testing
Static and DynamicSlicingComparison
 StaticSlicing
 Considersallpossiblepaths
 Slicingcostischeaper
 Staticallyavailableinformationonly
 Noassumptionsmadeoninput
 Computedsliceis ingeneralinaccurate
 Identifyingminimalslicesisanundecidableproblem
 Resultsmaynotbeuseful
 DynamicSlicing
 Onlyconsidersaspecifiedexecuted path
 Slicesizeissmaller
 Computedonagiveninput
 Usefulforapplicationssuchasdebuggingandtesting
4/14Software Slicing & Testing
Slicing
 Program dependence graph
 Statements are nodes, and data and control dependencies are the
edges
 Data dependence graph
Describes in the assignment statements the left value to the right value
dependence relationship
 Control dependence graph
Describes in a program the conditional statements and circular statements with
the statements embedded in them, their control relationship
Statements in the branches of if or while statements are control dependent on
the control predicate
5/14Software Slicing & Testing
Program DependenceGraph
6/14Software Slicing & Testing
Cited from http://slideplayer.com/slide/4238936/
Testing
• AnOverview ofWhite BoxTesting
• AnOverview ofBlackBoxTesting
• White andBlackBoxTestingComparison
7/14
 White box testing is the testing of a software solution’s
internal coding and infrastructure
 Focuses on security and improves design and usability
White Box Testing
8/14Software Slicing & Testing
Fig) Like see-through box concept
Cited from https://global.rakuten.com/ko/store/hanjo/item/10012725/
 Internal security holes
 Broken or poorly structured paths in the coding process
 The flow of specific inputs through the code
 Expected output
 The functionality of conditional loops
 Testing of each statement, object, and function on an individual
basis
White Box Verification
9/14Software Slicing & Testing
White BoxTesting
10/14Software Slicing & Testing
White Box Testing
Code coverage Analysis
Branch Coverage Statement Coverage
There are the other coverages such as condition, multi condition, path, function…
;however, branch and statement will cover 80-90% which is sufficient.
 It identifies areas of a program that are not exercised by a set of test
cases.
 Once gap are identified, you create test cases to verify untested
parts of code, thereby increase the quality of the software product.
 Branch coverage checks every possible path ( if-else and other
conditional loops ) of a software application.
 Statement coverage requires every possible statement in the code
to be tested at least once during the testing process.
Code Coverage Analysis
11/14Software Slicing & Testing
 Functionality of the software under test is checked without looking
at the internal code structure, implementation details or knowledge
of internal paths of the software.
 Based entirely on the software requirements and specifications
Black Box Testing
12/14Software Slicing & Testing
Cited from https://imgur.com/gallery/EL0jZ8e
Not being able to see the inner workings of the
Software so that only the end-user experience can
be tested
 Therefore, you can test these applications by just focusing on the
inputs and outputs without knowing their internal code
implementation.
 There are three types of black box testing.
 Functional testing
 Non-functional testing
 Regression testing
Black Box Testing
13/14Software Slicing & Testing
 White box testing (which is unit testing) validates internal structure
and working of your software code.
 The main focus of black box testing is validation of functional
requirements.
 Black box testing gives abstraction from code and focuses testing
effort on the software system behavior.
White and Black Box Testing Comparison
14/14Software Slicing & Testing
Thank You.
24th May, 2018
t76lee@uwaterloo.ca

Slicing and testing

  • 1.
    Software Slicing &Testing Taegeon Lee t76lee@uwaterloo.ca Advisor: Prof. Doo-Hwan Bae bae@se.kaist.ac.kr Teaching Assistant: Jiyoung Song jysong@se.kaist.ac.kr
  • 2.
    Slicing • AnOverview ofProgramingSlicing •Static andDynamicSlicingComparison • ProgramDependenceGraph 2/14
  • 3.
    Slicing Introduction Background OverallApproach Methodology Experiments Results Conclusion Discussion  Programslicingis atechniquefor simplifyingprogramsby focusing on selectedaspectsof semantics.  Static,dynamic,conditioned,andamorphous slicingare mainforms of slice.  Staticslicing Constructedbydeleting irrelevant partsoftheprogram Nothingaboutinput Program dependencegraph canbeused  Dynamicslicing Constructaslicewhichexploitedtheinformationavailable abouttheinputwhichcaused theprogramtogowrong  There are manyapplicationssuch as debugging,cohesion measurement, comprehension,maintenance andso on. 3/14Software Slicing & Testing
  • 4.
    Static and DynamicSlicingComparison StaticSlicing  Considersallpossiblepaths  Slicingcostischeaper  Staticallyavailableinformationonly  Noassumptionsmadeoninput  Computedsliceis ingeneralinaccurate  Identifyingminimalslicesisanundecidableproblem  Resultsmaynotbeuseful  DynamicSlicing  Onlyconsidersaspecifiedexecuted path  Slicesizeissmaller  Computedonagiveninput  Usefulforapplicationssuchasdebuggingandtesting 4/14Software Slicing & Testing
  • 5.
    Slicing  Program dependencegraph  Statements are nodes, and data and control dependencies are the edges  Data dependence graph Describes in the assignment statements the left value to the right value dependence relationship  Control dependence graph Describes in a program the conditional statements and circular statements with the statements embedded in them, their control relationship Statements in the branches of if or while statements are control dependent on the control predicate 5/14Software Slicing & Testing
  • 6.
    Program DependenceGraph 6/14Software Slicing& Testing Cited from http://slideplayer.com/slide/4238936/
  • 7.
    Testing • AnOverview ofWhiteBoxTesting • AnOverview ofBlackBoxTesting • White andBlackBoxTestingComparison 7/14
  • 8.
     White boxtesting is the testing of a software solution’s internal coding and infrastructure  Focuses on security and improves design and usability White Box Testing 8/14Software Slicing & Testing Fig) Like see-through box concept Cited from https://global.rakuten.com/ko/store/hanjo/item/10012725/
  • 9.
     Internal securityholes  Broken or poorly structured paths in the coding process  The flow of specific inputs through the code  Expected output  The functionality of conditional loops  Testing of each statement, object, and function on an individual basis White Box Verification 9/14Software Slicing & Testing
  • 10.
    White BoxTesting 10/14Software Slicing& Testing White Box Testing Code coverage Analysis Branch Coverage Statement Coverage There are the other coverages such as condition, multi condition, path, function… ;however, branch and statement will cover 80-90% which is sufficient.
  • 11.
     It identifiesareas of a program that are not exercised by a set of test cases.  Once gap are identified, you create test cases to verify untested parts of code, thereby increase the quality of the software product.  Branch coverage checks every possible path ( if-else and other conditional loops ) of a software application.  Statement coverage requires every possible statement in the code to be tested at least once during the testing process. Code Coverage Analysis 11/14Software Slicing & Testing
  • 12.
     Functionality ofthe software under test is checked without looking at the internal code structure, implementation details or knowledge of internal paths of the software.  Based entirely on the software requirements and specifications Black Box Testing 12/14Software Slicing & Testing Cited from https://imgur.com/gallery/EL0jZ8e Not being able to see the inner workings of the Software so that only the end-user experience can be tested
  • 13.
     Therefore, youcan test these applications by just focusing on the inputs and outputs without knowing their internal code implementation.  There are three types of black box testing.  Functional testing  Non-functional testing  Regression testing Black Box Testing 13/14Software Slicing & Testing
  • 14.
     White boxtesting (which is unit testing) validates internal structure and working of your software code.  The main focus of black box testing is validation of functional requirements.  Black box testing gives abstraction from code and focuses testing effort on the software system behavior. White and Black Box Testing Comparison 14/14Software Slicing & Testing
  • 15.
    Thank You. 24th May,2018 t76lee@uwaterloo.ca

Editor's Notes

  • #3 Static slicing & dynamic slicing Control dependence graph Data dependence graph There is partial analysis , measurement : slice size , execution time, analysis time Partial analysis has a value between static and dynamic
  • #4 Dynamic Slicing Static Slicing Program dependence graph Control dependence graph Data dependence graph
  • #5 Static slicing size is larger than dynamic slicing since it considers all possible paths. Dynamic slicing cost is more expensive than static slicing since recording an execution trace needs much cost.
  • #6 Statements are the nodes, and data and control dependencies are the edges.
  • #7 Numbering statements : except if-then-else and while-do
  • #10 It involves, checking a series of predefined inputs against expected or desired outputs, so that when a specific input does not result in the expected output, you have encountered a bug.
  • #14 Functional Testing : This black box testing type is related to functional requirements of a system. Non–Functional Testing : This type of black box testing is not related to testing of a specific functionality, but non-functional requirements such as performance, scalability and usability. Regression Testing : It’s done after code fixes, upgrades or any other system maintenance to check the new code has not affected the existing code.