Code-Based Testing of Extended Finite State Machine Models - PPT - v4
Code-Based Testing of Extended Finite State Machine Models - PPT - v4
Supervised by
Dr. Khaled El-Fakih
OUTLINE
Introduction
Preliminaries
EFSM Model
Mutants
Test Cases and Test Suites
Previous Work
Fault Coverage
Considered EFSM Examples
Considered Faults (Mutants)
Considered Test Cases and Test Suites
Assessment Methodology
Results and Ranking 2
Conclusion
INTRODUCTION
An EFSM (Extended Finite State Machine) model M is an
extension of an FSM with the addition of variables,
predicates or guards, update statements and parameters.
5
FAULTS (MUTANTS)
Mutants are a way of modeling faults
In code-based testing
Added by inserting, replacing, or deleting operators
Can be arithmetic, conditional, logical, etc.
6
CODE-BASED MUTANTS : ARITHMETIC MUTANTS
Arithmetic Operator Replacement – Binary (AORB)
𝐴 =𝐴+5 → 𝐴 =𝐴−5
8
CODE-BASED MUTANTS (CONT.)
Relational Operator Replacement (ROR)
A>𝐵→ 𝐴<𝐵
9
TEST CASES AND TEST SUITES
A test case
Finite sequence of inputs and outputs derived from the
specification (or its flow-graph)
10
EFSM FLOW-GRAPH BASED TEST SUITES
All-Uses Test Suite
Covers the All-Definition Use Pairs of all context variables
and parameterized input
Used DataFlow Testing Tool for deriving All Uses Test paths and
Data Flow Coverage web application tool for Edge Pair Test
paths and Test Cases.
11
STEPS FOR CODE-BASED TESTING
Define a FG and
number each node
Create TC and TS
[1]K. El-Fakih, A. Simao, N. Jadoon and J. Maldonado, “An assessment of extended finite state machine
test selection criteria”, Journal of Systems and Software, vol. 123, pp. 106-118, 2017. 13
[2] K. El-Fakih, T. Salameh and N. Yevtushenko, “On code coverage of extended FSM based test suites:
An initial assessment”, Proc. of the 26th International Conference on Testing Software and Systems, pp.
198-204, 2014.
OBJECTIVE
This paper evaluates code-based All-Uses test suites of
three well-known EFSM application examples and
compares their fault coverage to that achieved by
model-based All-Uses test suites.
14
CONSIDERED EFSM EXAMPLES
number:=0
Responder t3: IDISreq/DR
t2: CR/ICONind
disconnected wait
Initiator
nd
Ni
t8
O
:
IC
ID
TFTP
R/
IS
t1: IDISreq/DR
:C
t4: ICON_resp/CC
re
t7
q/
number:=0
DR
POP3 connected
15
CD player
VISUSTIN V7.10- GENERATING FLOW GRAPHS
16
DEFS-USES DERIVED FROM RESPONDER FG
Variables All defs All uses
Total number of nodes: 1-29
IDISreq 1 4 21 24
All Edges: {1 2}, {2 20}, {2 3},
DR 1 8 22 {3 6}, {3 4}, {4 7}, {4 5}, {7 2},
{5 2} , {5 8}, {8 9}, {9 10},{ 9
CR 1 11 2}, {10 11}, {10 12}, {12 20},
ICONind 1 7 28 {11 13}, {11 24}, {13 14}, {14
15}, { 14 24}, {15 16}, {15 17},
ICON_resp 1 5 18 {17 20}, {16 19}, {16 18}, { 19
DT1 1 16
23}, {23 29, {23 25}, {25 26},
{25 27}, {27 29}, {26 29}, {29
DT0 1 16 14}, {18 22}, {18 21}, { 22 24},
{ 21 24}, {21 14}, {24 28} , {24
CC 1 13 9 }, {28 2}
AK 1 29 Initial Node: 1
Input 1 3 15 4 5 11 19 18 21 24 Final Node: 20
return_value 1 7 8 13 29 28 22 6 7 8 12 13 16 17
22 28 29
26
num 1 19 23 29
number 1 13 27 26 23 25
TOOLS FOR GENERATING EXECUTABLE ALL USES TEST
PATHS
18
JUNIT TEST CASE
JUnit is a unit testing framework for the Java
programming language.
19
CONSIDERED MUTANTS
Category Operator Description
AORB Arithmetic Operator Replacement - Binary
AORS Arithmetic Operator Replacement - Shortcut
Arithmetic
AOIS Arithmetic Operator Insertion - Shortcut
21
CONSIDERED MUTANTS (MUCLIPSE)
22
CONSIDERED MUTANTS (MUCLIPSE)
23
CONSIDERED MUTANTS (MUCLIPSE)
24
ASSESSMENT METHODOLOGY
25
ASSESSMENT METHODOLOGY (CONT.)
Fault coverage measured by:
𝑪𝒐𝒗𝒆𝒓𝒂𝒈𝒆_𝑳𝒆𝒏𝒈𝒕𝒉_𝑺𝒄𝒐𝒓𝒆
= (𝐹𝑎𝑢𝑙𝑡_𝐶𝑜𝑣𝑒𝑟𝑎𝑔𝑒_𝑜𝑓_𝑇𝑆) 𝑊𝐹𝐶 + (𝑙𝑒𝑛𝑔𝑡ℎ_𝑜𝑓_𝑇𝑆) 𝑊𝐿𝑒𝑛𝑔𝑡ℎ
26
RESULTS AND RANKING
Assessment of standard deviation per each mutation
operator
Assessment of test suites per each mutation operator
27
PROTOCOLS CONSIDERED
Three well-known communication protocol
EFSMs were considered in this procedure:
The Responder
The SCP
28
ASSESSMENT OF AVERAGE MUTATION OPERATOR COVERAGE
PER EACH MUTATION OPERATOR (RESPONDER)
29
ASSESSMENT OF TEST SUITES PER EACH
MUTATION OPERATOR (ALL EXAMPLES)
Arithmetic Conditional Relational
All Examples
AOIS COR COI COD ROR
All-Uses Code 58.7% 47% 76% 100% 47.3%
All Uses 46.7% 31.3% 75.7% 97.7% 42.7%
30
FAULT COVERAGE ASSESSMENT FOR ALL
CONSIDERED EXAMPLES
31
RANKING OF TEST SUITE COVERAGE OF ALL
TYPES OF CONSIDERED FAULTS (COMPARE)
32
CONCLUSION
Code-based All-Uses test suites achieved 63.7% and 64.2 in terms of
the mutation score and coverage length score, respectively, allowing
it to slightly outperform model-based All-Uses test suites, which
attained 58.7% and 58.6 in terms of the same assessment metrics.
Code-based and model-based All-Uses test suites provided the
highest fault coverage of 100% and 97.7%, correspondingly, in terms
mutation score for COD-based mutants, while the lowest mutation
scores of 47.3% and 42.7% were achieved when the test suites were
applied on ROR-based mutants.
Fault coverage of conditional mutants is the highest for both test
suites, while that of rational mutants is the lowest.
More examples need to be considered
33
REFERENCES
[1] S. Sarraf, F. DeebaHasan and N. Garg, “A comparative study of data flow testing techniques”, International
Journal of Latest Trends in Engineering and Technology (IJLTET), vol. 2, no. 2, pp. 280-285, 2013.
[2] Guru99.com, 2016. [Online]. Available: http://www.guru99.com/static-dynamic-testing.html. [Accessed: 23-
Oct- 2016].
[3] V. Alagar and K. Periyasamy, Specification of software systems. London: Springer, 2011.
[4] A. Petrenko, S. Boroday and R. Groz, “Confirming configurations in EFSM Testing”, IEEE TSE, vol. 30, no. 1,
pp. 29-42, 2004.
[5] J. Badlaney, R. Ghatol and R. Jadhwani, "An introduction to data-flow testing", North Carolina State
University. Dept. of Computer Science, 2006.
[6] Y. Jia and M. Harman, “An Analysis and Survey of the Development of Mutation Testing”, IEEE
Transactions on Software Engineering, vol. 37, no. 5, pp. 649-678, 2011.
[7] G. Lu and H. Miao, “An Approach to Generating Test Data for EFSM Paths Considering Condition
Coverage”, Electronic Notes in Theoretical Computer Science, vol. 309, pp. 13-29, 2014.
[8] T. Shu, Z. Ding, M. Chen and J. Xia, “A heuristic transition executability analysis method for generating
EFSM-specified protocol test sequences”, Information Sciences, vol. 370-371, pp. 63-78, 2016.
[9] J. Ferrer, P. Kruse, F. Chicano and E. Alba, “Search based algorithms for test sequence generation in
functional testing”, Information and Software Technology, vol. 58, pp. 419-432, 2015.
[10] A. Pretschner, H. Lötzbeyer and J. Philipps, “Model based testing in incremental system development”,
Journal of Systems and Software, vol. 70, no. 3, pp. 315-329, 2004.
[11] A. Kalaji, R. Hierons and S. Swift, “An integrated search-based approach for automatic testing from
extended finite state machine (EFSM) models”, Information and Software Technology, vol. 53, no. 12, pp. 1297-
1318, 2011.
34
[12] P. Braione, G. Denaro, A. Mattavelli, M. Vivanti and A. Muhammad, “Software testing with code-based test
generators: data and lessons learned from a case study with an industrial software component”, Software Qual
J, vol. 22, no. 2, pp. 311-333, 2013.
REFERENCES
[13] N. Li, U. Praphamontripong and J. Offutt, “An Experimental comparison of four unit test criteria: Mutation,
edge, all-uses and prime path coverage”, Mutation, pp. 220-229, 2009.
[14] I. Bluemke and K. Kulesza, “Reductions of Operators in Java Mutation Testing”, Proceedings of the Ninth
International Conference on Dependability and Complex Systems DepCoS-RELCOMEX. June 30 – July 4, 2014,
Brunów, Poland, pp. 93-102, 2014.
[15] J. Strug and B. Strug, “Machine Learning Approach in Mutation Testing”, Testing Software and Systems,
pp. 200-214, 2012.
[16] K. El-Fakih, A. Simao, N. Jadoon and J. Maldonado, “An assessment of extended finite state machine test
selection criteria”, Journal of Systems and Software, vol. 123, pp. 106-118, 2017.
[17] K. El-Fakih, T. Salameh and N. Yevtushenko, “On code coverage of extended FSM based test suites: An
initial assessment”, Proc. of the 26th International Conference on Testing Software and Systems, pp. 198-204,
2014.
[18] RFC1350 – The TFTP Protocol (revision 2). URL: http://www.rfc-editor.org/rfc/rfc1350.txt
[19] RFC1939, “Post office protocol - version 3,” 1996.
[20] D. Hogrefe, OSI formal specification case study: the Inres protocol and service, Bern: Switzerland, 1992.
[21] W. H. Chen, “Executable test sequences for the protocol data flow property”, Int. Conference on Formal
Techniques for Networked and Distributed Systems, pp. 285-299, 2011.
[22] D. Seifert, Conformance testing based on uml state machines. In Formal Methods and Software Engineering,
London: Springer, 2008.
[23] Y. S. Ma, J. Offutt and Y. R. Kwon: “MuJava: An automated class mutation system”, JSTVR, vol. 15, no. 2,
pp. 97-133, 2005.
[24] "Visustin - Flow chart generator", Aivosto.com, 2016. [Online]. Available: 35
http://www.aivosto.com/visustin.html. [Accessed: 23- Oct- 2016].
[25] M. Hassoun, "Fault Coverage and Diagnosis of Protocols and Systems Modeled As Extended Finite State
Machines," M.S. Thesis, Dept. Computer Science and Eng., American University of Sharjah, 2015.
THANK YOU
36