GA and SA
GA and SA
GA and SA
180
Kivanc Doganay
2014Doganay
Kivanc
2014
As the world is getting more and more competitive, efficiency has become a
bigger concern than ever for many businesses. Certain efficiency concerns can
naturally be expressed as optimization problems, which is a well studied field
in the academia. However, optimization algorithms are not as widely employed
in industrial practice as they could. There are various reasons for the lack of
widespread adoption. For example, it can be difficult or even impossible for
non-experts to formulate a detailed mathematical model of the problem. On the
other hand, a scientist usually does not have a deep enough understanding of
critical business details, and may fail to capture enough details of the real-world
phenomenon of concern. While a model at an arbitrary abstraction level is
often good enough to demonstrate the optimization approach, ignoring relevant
aspects can easily render the solution impractical for the industry. This is an
important problem, because applicability concerns hinder the possible gains
that can be achieved by using the academic knowledge in industrial practice.
In this thesis, we study the challenges of industrial optimization problems
in the form of four case studies at four different companies, in the domains of
maintenance schedule optimization and search-based software testing. Working
with multiple case studies in different domains allows us to better understand
the possible gains and practical challenges in applying optimization methods in
an industrial setting. Often there is a need to trade precision for applicability,
which is typically very context dependent. Therefore, we compare our results
against base values, e.g., results from simpler algorithms or the state of the
practice in the given context, where applicable.
Even though we cannot claim that optimization methods are applicable in
all situations, our work serves as an empirical evidence for the usability of
optimization methods for improvements in different industrial contexts. We
hope that our work can encourage the adoption of optimization techniques by
more industrial practitioners.
i
Acknowledgments
First of all, I would like to thank my supervisors Markus Bohlin, Paul Pettersson,
Sigrid Eldh, and also my co-authors in all papers, without whom this thesis
would not be possible.
I shall thank the ITS-EASY crowd; both the organizing team, supporters at
various forms, and also the other students. Each event has been both instructional
and very much fun.
Both MdH and SICS are great workplaces that I very much enjoy being
part of. Thanks to my great colleagues, both places have served very valuable
experiences to me. I would like to thank everybody at MdH and SICS, for
creating a nice and fruitful work environment.
I want to give a special shout-out to my fellows that I have shared many
rides while traveling to ATAC project meetings. Even though my probability
of sitting in the middle was disproportionately high, it has always been fun to
hang out.
Lastly, you the reader; thank you. If you came this far without skipping any
lines, you have read at least one page of my thesis. How cool is that! I hope
you enjoy the rest as well.
Kivanc Doganay
Vsters, September 2014
iii
List of Publications
v
vi
I Thesis 1
1 Introduction 3
1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.1 Maintenance Schedule Optimization . . . . . . . . . . 4
1.1.2 Search-based Software Testing . . . . . . . . . . . . . 6
1.2 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Research Summary 9
2.1 Motivation and Problem Statement . . . . . . . . . . . . . . . 9
2.2 Research Contributions . . . . . . . . . . . . . . . . . . . . . 10
2.2.1 Overview of the Papers . . . . . . . . . . . . . . . . . 12
2.3 Research Methodology . . . . . . . . . . . . . . . . . . . . . 16
3 Related Work 17
3.1 Maintenance Schedule Optimization . . . . . . . . . . . . . . 17
3.2 Search-based Software Testing . . . . . . . . . . . . . . . . . 19
4 Conclusions 21
4.1 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Bibliography 25
II Included Papers 31
5 Paper A:
A Tool for Gas Turbine Maintenance Scheduling 33
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
vii
viii Contents
6 Paper B:
Maintenance Plan Optimization for a Train Fleet 55
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.1.1 Vehicle maintenance . . . . . . . . . . . . . . . . . . 57
6.2 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.3 Optimization Model . . . . . . . . . . . . . . . . . . . . . . . 60
6.4 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.4.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.5 Conclusion and Future Work . . . . . . . . . . . . . . . . . . 66
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
7 Paper C:
An Integrated Adaptive Maintenance Concept 69
7.1 Background and Relevance . . . . . . . . . . . . . . . . . . . 71
7.2 Vision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.3 Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
7.3.1 Brake Pads . . . . . . . . . . . . . . . . . . . . . . . 74
7.3.2 Condition Monitoring of Pantograph Contact Strip . . 75
7.3.3 Maintenance Planning . . . . . . . . . . . . . . . . . 77
Contents ix
8 Paper D:
Search Based Testing of Embedded Systems Implemented in IEC
61131-3: An Industrial Case Study 83
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
8.1.1 IEC 61131 Control Systems . . . . . . . . . . . . . . 86
8.1.2 Related Work . . . . . . . . . . . . . . . . . . . . . . 88
8.2 Search-Based Test Case Generation for a POU . . . . . . . . . 88
8.2.1 MC/DC for Function Blocks Diagrams . . . . . . . . 89
8.2.2 Stateful POUs . . . . . . . . . . . . . . . . . . . . . 90
8.2.3 Coverage Measurement . . . . . . . . . . . . . . . . . 91
8.2.4 Hill Climbing . . . . . . . . . . . . . . . . . . . . . . 91
8.2.5 Random Testing . . . . . . . . . . . . . . . . . . . . 94
8.3 Experimental Evaluation . . . . . . . . . . . . . . . . . . . . 94
8.3.1 Experimental Results . . . . . . . . . . . . . . . . . . 95
8.3.2 Discussion of the Results . . . . . . . . . . . . . . . . 98
8.3.3 Threats to Validity . . . . . . . . . . . . . . . . . . . 99
8.4 Conclusions and Future Work . . . . . . . . . . . . . . . . . . 100
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
9 Paper E:
MOS: An Integrated Model-Based and Search-Based Testing Tool
for Function Block Diagrams 103
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
9.2 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . 106
9.3 Tool Overview . . . . . . . . . . . . . . . . . . . . . . . . . 107
9.3.1 Model-Based Test Generation for FBDs . . . . . . . . 108
9.3.2 Search-Based Software Testing for FBDs . . . . . . . 111
9.4 Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
9.4.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . 115
9.4.2 Implications . . . . . . . . . . . . . . . . . . . . . . 116
9.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
9.6 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 117
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
x Contents
10 Paper F:
Search-based Testing for Embedded Telecommunication Software
with Complex Input Structures: An Industrial Case Study 121
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
10.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
10.2.1 Hill Climbing . . . . . . . . . . . . . . . . . . . . . . 124
10.2.2 (1+1)EA . . . . . . . . . . . . . . . . . . . . . . . . 125
10.2.3 Random Search . . . . . . . . . . . . . . . . . . . . . 125
10.3 System Under Test . . . . . . . . . . . . . . . . . . . . . . . 125
10.3.1 Analysis and Instrumentation . . . . . . . . . . . . . 126
10.3.2 Execution Environment . . . . . . . . . . . . . . . . . 127
10.4 Experimental Evaluation . . . . . . . . . . . . . . . . . . . . 128
10.4.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . 129
10.5 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
10.5.1 Discussion on the Results . . . . . . . . . . . . . . . 133
10.5.2 Discussion on the Case Study . . . . . . . . . . . . . 133
10.5.3 Threats to Validity . . . . . . . . . . . . . . . . . . . 134
10.6 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . 134
10.7 Conclusion and Future Work . . . . . . . . . . . . . . . . . . 135
10.8 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 136
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
I
Thesis
1
Chapter 1
Introduction
3
4 Chapter 1. Introduction
AB (SIT AB) is the first case study. Results of this study is deployed in the
form of a software program, and is currently used by SIT AB. The second case
study in the maintenance scheduling domain is the train fleet maintenance at
EuroMaint AB. Maintenance scheduling for train units is further complicated
by indirect relations between different units, such as shared costs and workshop
resource constraints.
The second domain is software testing for embedded systems. Search-based
software testing (SBST) translates testing goals into optimization problems,
where metaheuristic search algorithms can be applied. In recent years, SBST
methods have been shown to perform well on relatively small scale examples
of open source software. Applying SBST on industrial level code is an under-
studied topic, especially for embedded software. We apply the SBST approach
on two different industrial systems; Bombardier Transportations train control
software and Ericssons telecommunications platform. These two case studies
pose further challenges due to the implementation paradigms that are encoun-
tered in embedded software, and hence are not well investigated in the SBST
literature.
1.1 Background
1.1.1 Maintenance Schedule Optimization
Maintenance scheduling is an important problem in application domains that
employ sophisticated heavy machinery, such as airplanes or trains, as time spent
on maintenance disrupts the normal operation. However, industrial breakdowns
can have effects ranging from high costs due to production losses to catastrophic
consequences, including physical injury and loss of life. For example, if the
pantograph contact strip of a train is not maintained in time this can cause
damage to the overhead electricity line and affect operation of other trains on
the same line, which would lead to severe operation interruptions and high
costs. In order to avoid such breakdowns, maintenance strategies often include
preventive maintenance.
A simple and straightforward maintenance strategy is to maintain each com-
ponent in the system at its predetermined cycle, usually measured in operation
time, distance, or similar. As an example, consider a personal car. If the engine
oil degrades to an unsafe condition, a warning light on the dashboard would in-
dicate this to the driver. In such a situation the driver should turn off the engine,
investigate the problem, and probably change the oil at a nearby mechanic. This
1.1 Background 5
Figure 1.1: The search space that results from the objective function formulation
of the branch coverage example.
5 at the if statement that the execution diverges. Then the approach level and
branch distance tuple of (1, 5) is the current objective value. Depending on the
search algorithm that we want to use, it might be necessary to combine the two
into a single value. Typically the full range of the branch distance is not known,
but we can normalize it to the [0 1] range using the following formula:
1 dist where typically = 1.001
For the example input vector of <x=10,y=5>, the combined approach level
and normalized branch distance would be 1 + (1 5 ) 1.005. This value
shows how close the input vector to reach the target branch. An input vector
that executes the target branch would have the objective value of 0. Hence this
formulation of branch coverage problem translates into a minimization problem
with an optimum at 0, where various search-based optimization algorithms can
be applied. The objective function for a section of possible <x,y> values is
visualized in Figure 1.1.
SBST has been successfully used for various test data generation problems,
not only for structural coverage but also other purposes such as functional testing
and non-functional testing. The objective function needs to reflect the testing
purpose. For instance, consider generating test data for analyzing worst case
execution time, where the goal is to find test inputs that take longer to execute
the system. Then a reasonable objective function is the execution time itself,
8 Chapter 1. Introduction
Research Summary
9
10 Chapter 2. Research Summary
for such systems (RQ2). Once again, we are also interested in the performance
of the search algorithms, but this time with respect to satisfying testing goals
(RQ3).
The research aims that are mentioned above are summarized in the form of
the following research questions:
RQ1: How can the data from industrial systems be used to optimize operations
and maintenance scheduling?
RQ3: In these two domains, how does optimization methods perform compared
to other methods?
engine is used to find better schedules, which again exemplifies how to optimize
maintenance schedules (RQ1). A comparison against the cyclic block mainte-
nance schedules (a standard form of maintenance planning practice) is given to
quantify the merits of our approach, as an answer to the research question RQ3
in another industrial context.
Paper C positions the maintenance schedule optimization research (that is
discussed in paper A and B) in the bigger context of maintenance operations.
Low level sensor data acquisition, aggregation of the data, schedule optimization,
and high level decision making concerns are addressed in relation to each other
as a continuous chain process. This can be seen as a more general answer to the
question of how data from industrial systems can be used to optimize operations
(RQ1), or a holistic approach towards the goal of better and smarter industrial
maintenance.
The next three papers (paper D, E, and F) discuss the use of optimization al-
gorithms in the software testing domain. Paper D is a case study of search-based
software testing for an embedded industrial software, namely Bombardiers
train control software. The software under test has certain special properties
that are not typically found in SBST studies. For example branch coverage, a
common testing goal for SBST, do not make sense as there are no meaningful
branches in the given software. Instead we adapt to the structure of the system
under test by considering modified condition decision coverage (MC/DC) at
variable assignments (instead of branches), which relates to the question of how
to use SBST in such systems (RQ2). In the same study we also measure the
performance of the SBST techniques, in answer to the research question RQ3.
Paper E is about the same type of system that is used as a case study in
paper D, but this time usage of search-based methods in combination and com-
parison to a model-based approach is discussed. We argue that the combination
of the two methods can yield better overall results by complementing each
others shortcomings, and lead to higher confidence. This paper positions our
SBST work in a bigger context of software testing in relation to other testing
approaches, and serves as an answer to RQ2 with a wider perspective.
Paper F is another case study, this time on Ericssons telecommunications
software, again addressing applicability (RQ2) and performance (RQ3) concerns.
The system under test has a special execution environment that complicates
the practical implementation of the SBST techniques. Another complication
arises due to the complex data structures and non-trivial variables such as
uninitialized pointers, which are mostly unsupported in the SBST literature. We
parse existing test cases to automatically decide on how to initialize dynamic
data structures, and also to deduce certain contextual information in order to
12 Chapter 2. Research Summary
Included Papers
Paper A: A Tool for Gas Turbine Maintenance Scheduling. Markus Bohlin,
Kivanc Doganay, Per Kreuger, Rebecca Steinert, and Mathias Wrja. In
Proceedings of the Twenty-First Conference on Innovative Applications
of Artificial Intelligence (IAAI-09), pages 9-16, Pasadena, California,
USA, July 2009.
Related Work
17
18 Chapter 3. Related Work
which was developed by Ferguson and Korel [40]. The chaining approach is
based on analyzing the source code and finding the nodes in the control flow
graph with internal variables that may need to run to put the program in the
correct state. McMinn and Holcombe [41] use the chaining approach as a
fail-over mechanism when the primary evolutionary algorithm can not reach the
target branch.
Another major challenge in SBST occurs when inputs to a program are
complex dynamic data structures or pointers. According to Baars et al. [42],
problematic language constructs such as variable length argument functions,
pointers, and complex data types (variable size arrays, recursive types; lists,
trees, graphs, etc.) remain largely unsupported in SBST. Handling complex
input data structures is a major challenge for using SBST in an industrial
context [43].
Alshraideh and Botacci [44] use a genetic algorithm to generate test data for
covering branches with string predicates. Lakhotia et al. [45] combine search-
based testing and symbolic execution [46] to generate test data for pointer
inputs. They use an alternating variable hill climbing method with a set of
constraint solving rules. The problem of path explosion is solved by using a
lazy initialization approach for dynamic data structures.
Symbolic execution is also the basis for concolic testing [47, 48]. Concolic
testing uses symbolic execution to solve constraints by combining concrete
execution with symbolic generation of path conditions. A path condition is
constructed in symbolic execution which is a system of constraints in terms of
the input variables describing when the path will be executed. The path condition
can become too difficult to solve if it contains floating point arithmetic or non-
linear constraints. Inkumsah and Xie [49] combine SBST and concolic testing
in a framework for structural coverage of Java classes. Hybrid approaches that
combine concolic testing and SBST is an ongoing research area [50, 51].
Chapter 4
Conclusions
21
22 Chapter 4. Conclusions
[1] Bo Yang, Huajun Hu, and Lixin Jia. A study of uncertainty in software
cost and its impact on optimal software release time. IEEE Transactions
on Software Engineering, 34(6):813825, 2008.
[2] Antonia Bertolino. Software testing forever: Old and new processes and
techniques for validating todays applications. In Andreas Jedlitschka
and Outi Salo, editors, Product-Focused Software Process Improvement,
volume 5089 of Lecture Notes in Computer Science, pages 11. Springer
Berlin Heidelberg, 2008.
[8] Roger Cooke and Jette Paulsen. Concepts for measuring maintenance per-
formance and methods for analysing competing failure modes. Reliability
Engineering & System Safety, 55(2):135141, 1997.
25
26 Bibliography
[13] R. Dekker and P.A. Scarf. On the Impact of Optimisation Models in Main-
tenance Decision Making: the State of the Art. Reliability Engineering &
System Safety, 60(9):111119, 1998.
[19] Danny I. Cho and Mahmut Parlar. A survey of maintenance models for
multi-unit systems. European Journal of Operations Research, 51(1):123,
March 1991.
[20] Yasmina Hani, Lionel Amodeo, Farouk Yalaoui, and Haoxun Chen. Sim-
ulation based optimization of a train maintenance facility. Journal of
Intelligent Manufacturing, 19(3):293300, June 2008.
[21] Yasmina Hani, Hicham Chehade, Lionel Amodeo, and Farouk Yalaoui.
Simulation based optimization of a train maintenance facility model using
genetic algorithms. In 2006 Intl. Conf. Service Systems and Service
Management, volume 1, pages 513518, 2006.
[23] Markus Bohlin, Malin Forsgren, Anders Holst, Bjrn Levin, Martin Arons-
son, and Rebecca Steinert. Reducing vehicle maintenance using condition
monitoring and dynamic planning. In Proc. 4th IET Intl. Conf. on Railway
Condition Monitoring (RCM08), June 2008.
[24] Bjrn Levin, Anders Holst, Markus Bohlin, Rebecca Steinert, and Martin
Aronsson. Dynamic maintenance. In Proc. 21st Intl. Congress and Exhibi-
tion on Condition Monitoring and Diagnostic Engineering Management,
June 2008.
[27] Gbor Marti and Leo Kroon. Maintenance Routing for Train Units: The
Transition Model. Transportation Science, 39(4):518525, 2005.
28 Bibliography
[28] Gbor Marti and Leo Kroon. Maintenance Routing for Train Units: The
Interchange Model. Computers & Operations Research, 34(4):11211140,
April 2007.
[33] Phil McMinn. Search-based software testing: Past, present and future. In
2011 IEEE Fourth International Conference on Software Testing, Verifi-
cation and Validation Workshops (ICSTW), ICSTW 11, pages 153163,
Washington, DC, USA, 2011. IEEE Computer Society.
[34] Wasif Afzal, Richard Torkar, and Robert Feldt. A systematic review of
search-based testing for non-functional system properties. Information
and Software Technology, 51:957976, June 2009.
[39] G. Fraser and A. Arcuri. It is not the length that matters, it is how you
control it. In 2011 IEEE Fourth International Conference on Software
Testing, Verification and Validation (ICST), pages 150159. IEEE, March
2011.
[40] Roger Ferguson and Bogdan Korel. The chaining approach for software
test data generation. ACM Trans. Softw. Eng. Methodol., 5(1):6386,
January 1996. ACM ID: 226158.
[41] Phil Mcminn and Mike Holcombe. Hybridizing evolutionary testing with
the chaining approach. In Proceedings of the Genetic and Evolutionary
Computation Conference, volume 3103 of GECCO 2004, pages 1363
1374. Springer-Verlag, 2004.
[43] H. Gross, P.M. Kruse, J. Wegener, and T. Vos. Evolutionary white-box soft-
ware test with the EvoTest framework: A progress report. In International
Conference on Software Testing, Verification and Validation Workshops,
2009. ICSTW 09, pages 111120, April 2009.
[45] Kiran Lakhotia, Mark Harman, and Phil McMinn. Handling dynamic
data structures in search based testing. In Proceedings of the 10th Annual
Conference on Genetic and Evolutionary Computation (GECCO08), New
York, NY, USA, 2008. ACM.
[47] Patrice Godefroid, Nils Klarlund, and Koushik Sen. Dart: Directed auto-
mated random testing. SIGPLAN Notes, 40(6):213223, 2005.
[48] Koushik Sen, Darko Marinov, and Gul Agha. CUTE: A concolic unit
testing engine for C. SIGSOFT Software Engineering Notes, 30(5):263
272, 2005.
[49] Kobi Inkumsah and Tao Xie. Evacon: A framework for integrating evolu-
tionary and concolic testing for object-oriented programs. In Proceedings
of the 21st IEEE/ACM International Conference on Automated Software
Engineering (ASE07), New York, NY, USA, 2007. ACM.
[50] J. Burnim and K. Sen. Heuristics for scalable dynamic test generation.
In Proceedings of the 23rd IEEE/ACM International Conference on Au-
tomated Software Engineering (ASE08), Washington, DC, USA, 2008.
IEEE Computer Society.
[51] Rupak Majumdar and Koushik Sen. Hybrid concolic testing. In Pro-
ceedings of the 29th International Conference on Software Engineering
(ICSE07), Washington, DC, USA, 2007. IEEE Computer Society.