software testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/emsoc07_sha… ·...

19
EmSoC-Recherche Octobre 2007 1 Software Testability Muhammad Rabee Shaheen Lydie du Bousquet LIG - VASCO

Upload: others

Post on 10-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 1

Software Testability

Muhammad Rabee ShaheenLydie du Bousquet

LIG - VASCO

Page 2: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 2

Summary

Testability Current Work

–Source code measures analysis–DIT to predict cost of testing

Conclusion and perspectives

Page 3: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 3

Summary

Testability Current Work

–Source code measures analysis–DIT to predict cost of testing

Conclusion and perspectives

Page 4: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 4

What is the testability?

Several definitions General idea

– Testability is a system characteristic– Estimates the effort of testing

IEEE definition:“The degree to which a system or component facilitates

the establishment of test criteria and the performance of tests to determine whether those criteria have been met”

Page 5: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 5

Why testability is important

Software testing is expensiveCostly in terms of time and funds

Solution Design system / components easy to test = testable

“Design for Testability”

Page 6: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 6

Testability and hardware

Testability is an old term.– 1 design is manufactured in lots of blocks– design is supposed to be correct– defect may be introduced during manufacturing– each block has to be tested

Controllability and Observability–Controlling the inputs–Observing the outputs

Page 7: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 7

Testability and Software

Testing a hardware assumes complete functionalitycorrectness

Software testing assume the presence of functional faults

Page 8: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 8

Summary

Testability Current Work

–Source code measures analysis–DIT to predict cost of testing

Conclusion and perspectives

Page 9: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 9

Testability prediction and evaluation

A large number of measures–Source code:

• LOC, CC• Observability / Controllability, DRR, PIE, VC• C&K suite : DIT, WMC, NOC, CBO, RFC, LCOM• LCC, TCC, ICH, …• MIF, AIF…• Component’s measures:

–RCO, SCCr, SCCp…• Measures based on data flow / control graph

–Design

Anti-patterns testability

Page 10: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 10

All roads lead to Rome !!!

But not all measures lead to the testability…

Which measure to choose?

How much are they consistent?

Our work was analyzing several source codemeasures

Page 11: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 11

Why all these measures

Cost terms:– Quantity of tests (scope)– Effort required to test (Complexity)

Several test techniques– Measures are more or less related to test methods– Hypotheses.

Page 12: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 12

Examples

Cyclomatic Complexity CC:– CC is the number of decision statements,– # test cases expected to carry out path coverage criteria.

LOC :–Intuitively, the greater the number of lines, the greater

complexity,–Difficulty of observation.–Increasing the possibility of errors.

Page 13: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 13

On going work

Collecting measures / metrics– Source code– Design

Analysis– Testability criteria

• Coverage (linked to a testing method)• Assumptions / observations

– What type of testing cost• Number of tests• Difficulty of testing

– Empirical evaluation

Page 14: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 14

Depth of Inheritance Tree - DIT

DIT is one of C&K metric suite

DIT is the length of the longest path from a given classto the root class of the inheritance hierarchy

Intuitively the greater the depth of inheritance tree, thegreater the number of inherited methods

Page 15: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 15

Current work: DIT and cost of testing

Cost of testing– the required number of methods to test

Test strategies– Do not consider inheritance– Do consider inheritance (total/applicative)

DITT vs. DITA– DITT: is the total depth of inheritance tree– DITA: is the depth of inheritance tree restricted to

application’s classes

Page 16: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 16

Hypotheses & empirical validation

Considering inheritance– # inherited methods in a class is influenced by DITT– # inherited methods in a class is influenced by DITA

Without considering inheritance– # defined methods in a class is influenced by DITA/DITT

Experiments– 6 open-source applications (1700 classes)

– No correlation between DITT, DITA and # defined methods– DITA more relevant than DIT

Page 17: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 17

Summary

Testability Current Work

–Source code measures analysis–DIT to predict cost of testing

Conclusion and perspectives

Page 18: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 18

Conclusion & perspectives

Measures analysis–Studying the different proposed measures.–Testability criteria: coverage/observations–Validation–Choice Grid (measures, test method)

DIT–Formalization testability criteria–Validation by the experiments

Page 19: Software Testabilitysemba.conf.citi-lab.fr/emsoc/emsoc07/presentations/EmSoC07_Sha… · Testability prediction and evaluation A large number of measures –Source code: •LOC, CC

EmSoC-Recherche Octobre 2007 19

Thanks for your attention

Feedbacks are welcome