Helping students learn code coverage with RapiTetris
It’s been five years since the creation of RapiTetris and the game’s users keep growing. RapiTetris is our own take on the classic game of Tetris with a subset of RapiCover – our structural coverage analysis tool – built into the gameplay. It was created as a fun way to learn the basics of how code coverage works.
Over the years, RapiTetris has found a home in the academic world as a fun way for students to learn. The Hamburg University of Technology and Mälardalen University are some of these homes, where Dr.-Ing. Martin Halle and Dr. Adnan Causevic provide RapiTetris to their students.
One of the creators of RapiTetris, Dr. Antoine Colin, is delighted to see that computer science students all over the world have an interactive tool at their disposal to aid with code coverage learning.
Coverage made fun
Code coverage is a measurement of how many blocks of code are executed during automated testing; a good metric of how much testing you are doing. During game play, RapiTetris provides 4 types of coverage metric:
- Function coverage – has each subroutine in the code been called?
- Statement coverage– has every statement been executed?
- Decision coverage– has every branch of a control structure been explored? E.g. both the true and false branches of an if statement must be executed.
- Modified condition/decision coverage (MC/DC) – does each condition affect the decision outcome independently. This is of interest when trying to meet requirements for safety critical software (for example DO-178B/C standards for aerospace application)
The objective of the RapiTetris game is to obtain 100% code coverage within a limited amount of time. This can only be achieved by analyzing the game’s code. Although this isn’t how code coverage works in a “real” testing environment (as you do not look at the code directly), it’s a great, immersive way to learn the underlying concepts compared to writing some rigorous tests.
The evolution of RapiTetris
We’ve taken RapiTetris to numerous events and conferences the last five years, and it has proved to be a popular addition to our stand. In recent years we have revamped the RapiTetris game and unveiled a new and improved arcade box for the game to be played in – giving it a more ‘retro’ flavor. We challenge delegates to compete to achieve the best scores within a five-minute period, with prizes given - at selected events - to those with the top score at the end of the event.
More about RapiTetris and RapiCover
RapiTetris only showcases a fraction of the features of RapiCover. If you want to find out more about RapiCover and all its features, you can request a trial version which runs in a simulated embedded environment.
White papers & webinars
Want to learn about common challenges and solutions in critical software verification? Our white papers and webinars may be just the thing:
- Multicore Timing Analysis for DO-178C
- Eight top code coverage questions in embedded avionics systems
- Seven Roadblocks to 100% structural coverage (and how to avoid them)
- Automating WCET Analysis for DO-178B & DO-178C
- Three steps to avoid software obsolescence in avionic systems
- CodeTEST® Replacement with RVS
- Multicore Timing Analysis for DO178 Projects Webinar
- Multicore for ISO 262626 Webinar