Refactor

Once the functionality of code is known, the code can be tested or changed with understanding. This project will be using the SDL-Devil project.

In this assignment, you will build a test suite to verify that any changes made to a block of code do not break the code. Then, you will refactor the level statistics code in src/do_stat.c. As you make changes, you will need to test to verify that you have not introduced an incorrect refactor. You will need to create a script to diff your refactor output against the established output stats. Your test script should quickly identify if any errors are in the refactor.

Your goals:

  1. Create a program to output level stats
  2. Collect level stats before any other changes
  3. Design a testing framework to validate your refactor
  4. Refactor the stats code to a better state
    • Always make sure your refactor matches the original stat cases

I provide the fllowing:

The project groups are:

chanck fengy3
clonintl xiey2
calarejf petrisjj
hilliara chenj10
johnsor2 wangy18
mckownqa shenx
mongovsp liur5
proctem graziodj
schluncg neessc
sheffeit paytonzk
wangc6 shaferw
zhengj2 huangf1

Your groups repo is at gitter.csse.rose-hulman.edu:/repos/1819c-490-week3-USERNAME-USERNAME.

A few notes:

Rubric

Add harness to output stats 0 : No statistics 1 : Gets stats for a level
Test script to compare refactor output 0 : No script 1 : Comparison script
Script quickly indicates failures 0 : Report at end 1 : Immediate error abort
Test flexibiliti 0 : Hard coded 1 : Adapts to test data
Script correctly identifies errors 0 : Does not find errors 1 : Correctly finds errors
Levels of indention 0 : > 4 levels 1 : < 5 levels
Semantic meaning 0 : No semantic meaning 1 : All conditions have meaning
Complexity 0 : Hard to uunderstand code 1 : Code is simpler
Repetition 0 : Has repetition 1 : All repeated code abstracted out
Refactor correctness 0 : Incorrect 1 : Correct