Individual software foundation engineering - Sudoku 4

GITHUB Project Address:

https://github.com/hhz-hhz/Sudoku_software_engineer.git

Soft Engineering foundation of individual projects - Sudoku 1

Soft Engineering foundation of individual projects - Sudoku 2

Individual software foundation engineering - Sudoku 3

Fourth, the testing phase

1, as in test design documentation of procedures were tested:

But SolvingSudoku.cpp in:

Since the inline bool CheckingForDFS (int n, int key) and inline int SolvingByDFS (int n) global arrays are used, so there is no way to test them individually.

During GeneratingSudoku.cpp:

inline void MovingStep () is the same as the above case, so there is no way to test.

It can be seen that the global variable drawbacks for software development.

2, unit testing: See test code folder UnitTest

 

 3, test code coverage:

 

 4, after complete performance testing unit tests:

1) -c 1000000: generating a final test on

 

2) -s D: \ sudoku \ Debug \ sudokutest.txt: Solving 1000 final

 

 

 V. Summary and optimization phase

1, the subsequent optimization

About final solving, solving 1000 alone the number of time-consuming and needs to generate 1 million final time is almost the same, but when solving one million final and still take a long time, so performance analysis table from the point of view, the need for solving several the only way to optimize, you may want a simpler way to solve Sudoku. And read how the file also needs to be improved.

2, PSP form

 

 

 

 3, hindsight

1), for the progress of the project design

Because the unit tests themselves understand not deep enough with VS, so for some time estimated urgency, so for an accurate estimate ahead of time it is necessary.

2) For the project experience

经过这一次的体验,认识到编程并不是全部,提前的准备和后期的设计对于项目而言都是必要的。前期对于需求进行一个足够的分析,后期才能够不去花费力气。就像这次,我在测试的时候一度不明白怎么进行单元测试,看到的例子都是由C++完成的,虽然中间有用到C++的函数,但是最终的形式并不是对象,所以中途想将它变成C++的对象的方式,但是这时发现再想改它很困难,由于时间紧张,就并没有将其进行修改,但是中间有经过数次的尝试,所以在前期分析好需求,制定好计划,是对于项目而言一件重要的事。

3)、对于代码规范

在进行前的代码规范设计的时候,有很认真的去查过资料,所以这次是按照代码规范来的,虽然有些地方不够规范,但是对于重要的函数、变量,都提前进行了命名的设计,所以再此后的代码实现的时候会很轻松的找到自己书写的函数和变量,命名规范也很容易让我联想起它们的作用。

之后又进行了代码分析,之前的概念里warning不是一件重要的事,但是经过这次的代码分析,可以看出不够严谨的代码可能会对程序带来安全隐患。所以对于warning还是需要去理睬的。

4)、对于编译器的用法

经过这一次的项目开发,我对于编译器的认识又上了一个层次,像性能分析、单元测试等,之前也都是没操作过的,并且在这一次的实验中几乎是每一个关于操作这些新东西的错误都遇到过,所以对于以后的使用也有了一个较大的帮助。

5)、关于代码托管

由于不够熟练使用github,前期都是通过自己的备份,后期看到要求后,慢慢地去使用,发现代码托管对于代码的备份,代码的一致性都有很大的帮助

4、运行结果图

1)生成终局

2)、求解简单数独

 

3)、求解多个数独

 

Guess you like

Origin www.cnblogs.com/picaqiu/p/12216012.html