/*
void Main (void) {
Char AAA;
while (1) {
if (onesecondpassed ()) aaa++;
if (AAA >200) {
Class_is_over ();
}else{
Lesson_to_lecture ();
}
}
}
*/
This is a simple code for C + +
Function: Realize second time, more than 200s when class, otherwise listen.
Class_is_over (), Lesson_to_lecture (), onesecondpassed () can work properly
The above code has several errors.
1. Char AAA We all know that the range of char is -128~127, and the following if statement may cause AAA to appear with a value greater than 127.
2. aaa++ may cause an AAA overflow.
3. It is very likely that the loop inside the mouth will not jump out at the end.
The above basically belongs to some simple mistakes. As we all know, this simple error is often the cause of some unpredictable loss. Therefore, software testing is an indispensable link.
For most language beginners, the value range, usage, looping, looping nesting of each variable, and the use of some functions are the basic common sense that should be mastered, and we develop the habit of instant testing, and don't wait until all the code is complete before you start testing.
"Software Test" class Note 01