Skip to main content

An Empirical Study of Control Flow Graphs for Unit Testing

  • Conference paper
  • First Online:
Information Technology - New Generations

Part of the book series: Advances in Intelligent Systems and Computing ((AISC,volume 558))

  • 3178 Accesses

Abstract

This paper conducts an empirical study of a Control Flow Graphs (CFG) visualizer from which various test coverages can be exercised directly. First, we demonstrate how control structures are extracted from bytecode and compound conditions are decomposed into simple multi-level conditions in Java bytecode. Then, we visualize the decomposed compound conditions in CFG. The layout of a CFG is calculated by extending a force-directed drawing algorithm. Each control node of CFG represents a simple condition. The empirical study shows that (1) the tool successfully decomposes a compound condition into simple multi-level conditions and (2) the extended force-based layout algorithm produces the best layout for visualizing CFG.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 219.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. ABET Accreditation. [Online]. Available: http://www.abet.org/. Accessed 24 Sept 2019.

  2. Graphviz - Graph Visualization Software. [Online]. Available: http://www.graphviz.org/. Accessed 2 Feb 2016.

  3. Eclipse Foundation. [Online]. Available: http://www.eclipse.org/. Accessed 30 Nov 2015.

  4. Xu, W., Syed, A. R., Zheng, Q. (2015). A force-directed program graph visualizer for teaching white-box testing techniques. In ASEE annual conference and exposition. Seattle.

    Google Scholar 

  5. Eades, P. (1984). A heuristic for graph drawing. Congressus Numerantium, 160(42), 149.

    MathSciNet  Google Scholar 

  6. Jorgensen, P. C. (2008). Software testing: A craftsman's approach (3rd ed.). Boca Raton: Auerbach Publications.

    MATH  Google Scholar 

  7. Lindholm, T., Yellin, F., Bracha, G., & Buckley, A. (2013). The java® virtual machine specification. Boston: Addison-Wesley Professional.

    Google Scholar 

  8. How would you test a vending machine?. (2011). [Online]. Available: http://www.softwaretestingquestions.net/category/testing-in-the-wild/. Accessed 24 Jan 2013.

  9. Zhao, J. (1999). Analyzing control flow in ava bytecode. In 16th conference of Japan Society for software science and technology. Linz.

    Google Scholar 

  10. Sinha, S., & Harrold, M. J. (2000). Analysis and testing of programs with exception handling constructs. IEEE Transactions on Software Engineering, 26(9), 849–871.

    Article  Google Scholar 

  11. Amighi, A., PC, de Gomes., Gurov, D., Huisman, M. (2012). Sound control-flow graph extraction for Java programs with exceptions. In 10th international conference on software engineering and formal methods. Berlin/Heidelberg.

    Google Scholar 

  12. Di Battista, G., Eades, P., Tamassia, R., Tollis, I. G. (1998). Graph drawing: Algorithms for the visualization of graphs. Upper Saddle River: Prentice Hall PTR.

    Google Scholar 

  13. Würthinger, T. (2006). Visualization of java control flow graphs. Linz, Austria: Johannes Kepler University.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Weifeng Xu .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG

About this paper

Cite this paper

Xu, W., El Ariss, O., Liu, Y. (2018). An Empirical Study of Control Flow Graphs for Unit Testing. In: Latifi, S. (eds) Information Technology - New Generations. Advances in Intelligent Systems and Computing, vol 558. Springer, Cham. https://doi.org/10.1007/978-3-319-54978-1_69

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-54978-1_69

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-54977-4

  • Online ISBN: 978-3-319-54978-1

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics