diff --git a/courses/gnatdas/010_overview.rst b/courses/gnatdas/010_overview.rst index 44bfd6a16..d8a37b249 100644 --- a/courses/gnatdas/010_overview.rst +++ b/courses/gnatdas/010_overview.rst @@ -65,7 +65,7 @@ What Is Dynamic Analysis? What Is GNAT DAS? ------------------- -+ Two tools that can work together to analyze code execution ++ Tools that can work together to analyze code execution + :toolname:`GNATcoverage` @@ -74,3 +74,7 @@ What Is GNAT DAS? + :toolname:`GNATtest` + Creates framework to build software tests for your codebase + + + :toolname:`GNATfuzz` + + + Automates dynamic testing by generating and executing test cases to discover software vulnerabilities diff --git a/courses/gnatdas/cover_010_overview.rst b/courses/gnatdas/cover_010_overview.rst index 832bb633c..e61e41cd2 100644 --- a/courses/gnatdas/cover_010_overview.rst +++ b/courses/gnatdas/cover_010_overview.rst @@ -85,7 +85,7 @@ Statement Coverage .. image:: gnatdas/cover_statement.png :width: 75% -* Call :ada:`Test_Statement` with :ada:`(1, 2, Integer'Last)` +* Call :ada:`Test_Statement` with :ada:`(1, 2, Integer'Last, X)` * Congratulations: 100% Statement Coverage! But... @@ -109,7 +109,7 @@ Decision Coverage .. image:: gnatdas/cover_decision.png -* Call :ada:`Test_Decision` with :ada:`(0, 0, 0)` and :ada:`(1, 1, Integer'Last)` +* Call :ada:`Test_Decision` with :ada:`(0, 0, 0, X)` and :ada:`(1, 1, Integer'Last, X)` * Congratulations: 100% Decision Coverage! But... @@ -218,7 +218,7 @@ Modified Condition/Decision Coverage Example .. image:: gnatdas/cover_mcdc.png :width: 75% -* Call :ada:`Test_Mcdc` with :ada:`(1, 0, 0)`, :ada:`(0, 1, 0)`, and :ada:`(1, 1, 0)` +* Call :ada:`Test_Mcdc` with :ada:`(1, 0, 0, X)`, :ada:`(0, 1, 0, X)`, and :ada:`(1, 1, 0, X)` * Better test results, but we need more tests * In general, if there are N subconditions, need N+1 sets of data to get complete MCDC coverage diff --git a/courses/gnatdas/cover_030_advanced_topics.rst b/courses/gnatdas/cover_030_advanced_topics.rst index d722673b2..82b618dfa 100644 --- a/courses/gnatdas/cover_030_advanced_topics.rst +++ b/courses/gnatdas/cover_030_advanced_topics.rst @@ -352,7 +352,6 @@ xml .. container:: latex_environment tiny With exemptions - :: 60% of 5 lines covered diff --git a/courses/gnatdas/labs/test_030_controlling_gnattest.lab.rst b/courses/gnatdas/labs/test_030_controlling_gnattest.lab.rst index d330247f8..b9e0483db 100644 --- a/courses/gnatdas/labs/test_030_controlling_gnattest.lab.rst +++ b/courses/gnatdas/labs/test_030_controlling_gnattest.lab.rst @@ -57,9 +57,7 @@ Build Harness for One Unit Create Tests -------------- -* Re-write or copy the test answers from the *Usage* lab (or use these) - -.. container:: latex_environment tiny +* Re-write or copy the test answers from the *Usage* lab (here are some examples) .. code:: Ada @@ -96,35 +94,6 @@ Create Tests Reset; AUnit.Assertions.Assert (Empty, "Stack not empty"); - -- Full - while not Full loop - Push (567); - end loop; - Push (999); - AUnit.Assertions.Assert (Full and then Top = 567, - "Full check failed"); - - -- Top - Reset; - declare - Pushed : constant integer := 234; - begin - Push (Pushed); - AUnit.Assertions.Assert (Pushed = Top, - "Top test failed"); - end; - - -- Count - Reset; - Push (111); - AUnit.Assertions.Assert (Count = 1, - "Count test failed"); - - -- Reset - Reset; - AUnit.Assertions.Assert (Count = 0 and then Empty, - "Reset test failed"); - ----------------------------------- Ensure Every Test Starts the Same ----------------------------------- diff --git a/courses/gnatdas/test_020_usage.rst b/courses/gnatdas/test_020_usage.rst index 4dd3066d0..573a96128 100644 --- a/courses/gnatdas/test_020_usage.rst +++ b/courses/gnatdas/test_020_usage.rst @@ -69,6 +69,8 @@ Building a Test Harness * To run the driver, build and run the executable in the :filename:`obj/driver` folder + * Executable is called :command:`test_runner` + .. container:: latex_environment tiny :: @@ -77,7 +79,7 @@ Building a Test Harness gprbuild -P test_driver test_runner - Gives the result:: + *Gives the result* :: simple.ads:3:4: error: corresponding test FAILED: Test not implemented. (simple-test_data-tests.adb:44) simple.ads:7:4: error: corresponding test FAILED: Test not implemented. (simple-test_data-tests.adb:65) diff --git a/courses/gnatdas/test_040_advanced_testing.rst b/courses/gnatdas/test_040_advanced_testing.rst index 2c0b518f4..800812caa 100644 --- a/courses/gnatdas/test_040_advanced_testing.rst +++ b/courses/gnatdas/test_040_advanced_testing.rst @@ -134,9 +134,9 @@ Running Multiple Test Harnesses .. container:: latex_environment tiny - :: + .. code:: output - dependent.ads:2:4: error: corresponding test FAILED: Test not implemented. (dependent-test_data-tests.adb:44) + depend.ads:2:4: error: corresponding test FAILED: Test not implemented. (depend-test_data-tests.adb:44) simple.ads:7:4: error: corresponding test FAILED: Test not implemented. (simple-test_data-tests.adb:65) simple.ads:3:4: error: corresponding test FAILED: Test not implemented. (simple-test_data-tests.adb:44) 3 tests run: 0 passed; 3 failed; 0 crashed. diff --git a/courses/gnatsas/check_020_getting_started.rst b/courses/gnatsas/check_020_getting_started.rst index 711d37dca..385bfd506 100644 --- a/courses/gnatsas/check_020_getting_started.rst +++ b/courses/gnatsas/check_020_getting_started.rst @@ -99,24 +99,24 @@ Command Line Example Run :command:`gnatcheck -P simple.gpr -rules -from=coding_standard.rules` -:: - - chop.adb:14:11: PIck_Up does not have casing specified (mixed) - chop.ads:11:18: Stick does not start with subtype prefix T_ - phil.adb:21:11: Think_Times does not start with subtype prefix T_ - phil.adb:33:05: "Who_Am_I" is not modified, could be declared constant - phil.ads:12:03: violation of restriction "No_Tasking" - phil.ads:12:13: Philosopher does not start with subtype prefix T_ - phil.ads:12:26: My_ID does not have casing specified (mixed) - phil.ads:19:08: States does not end with type suffix _Type - phil.ads:19:08: States does not start with subtype prefix T_ - random_generic.ads:5:08: Result_Subtype does not end with type suffix _Type - random_generic.ads:5:08: Result_Subtype does not start with subtype prefix T_ - room.adb:19:03: violation of restriction "No_Tasking" - room.adb:19:23: anonymous subtype - ... - -.. container:: latex_environment footnotesize +.. container:: latex_environment scriptsize + + .. code:: output + + chop.adb:14:11: PIck_Up does not have casing specified (mixed) + chop.ads:11:18: Stick does not start with subtype prefix T_ + phil.adb:21:11: Think_Times does not start with subtype prefix T_ + phil.adb:33:05: "Who_Am_I" is not modified, could be declared constant + phil.ads:12:03: violation of restriction "No_Tasking" + phil.ads:12:13: Philosopher does not start with subtype prefix T_ + phil.ads:12:26: My_ID does not have casing specified (mixed) + phil.ads:19:08: States does not end with type suffix _Type + phil.ads:19:08: States does not start with subtype prefix T_ + random_generic.ads:5:08: Result_Subtype does not end with type suffix _Type + random_generic.ads:5:08: Result_Subtype does not start with subtype prefix T_ + room.adb:19:03: violation of restriction "No_Tasking" + room.adb:19:23: anonymous subtype + ... *These messages are coming from rules specified in* :filename:`coding_standard.rules` diff --git a/courses/gnatsas/check_040_lkql.rst b/courses/gnatsas/check_040_lkql.rst index 9e81b74f1..d04db5cb5 100644 --- a/courses/gnatsas/check_040_lkql.rst +++ b/courses/gnatsas/check_040_lkql.rst @@ -219,8 +219,6 @@ Mapping Python API to LKQL API val expr_types = [node.p_expression_type() for node in select Expr] -In the future LKQL will have its own LAL API documentation. - ------------------------------- Integrating LKQL in GNATcheck ------------------------------- diff --git a/courses/gnatsas/sas_010_introduction.rst b/courses/gnatsas/sas_010_introduction.rst index de6284789..f00974458 100644 --- a/courses/gnatsas/sas_010_introduction.rst +++ b/courses/gnatsas/sas_010_introduction.rst @@ -74,7 +74,7 @@ Why Use :toolname:`GNAT SAS`? + Efficient automated code reviewer - + Identifies run-time errors with a **level of certainty** + + Identifies runtime errors with a **level of certainty** + E.g. buffer overflows, division by zero diff --git a/courses/gnatsas/sas_020_overview.rst b/courses/gnatsas/sas_020_overview.rst index 5bda04f8a..f65a4abae 100644 --- a/courses/gnatsas/sas_020_overview.rst +++ b/courses/gnatsas/sas_020_overview.rst @@ -104,7 +104,7 @@ GNAT SAS in a Nutshell (2/2) + Detects runtime and logic errors - + Initialization errors, run-time errors and assertion failures + + Initialization errors, runtime errors and assertion failures + Race condition errors: unprotected access to globals + Warns on dead or suspicious code @@ -128,8 +128,8 @@ Integrated Analysis Engines + Inspector - + Excels in detecting possibly failing run-time checks as well as wide range of logical errors - + Determines preconditions on the inputs necessary to preclude run-time failures + + Excels in detecting possibly failing runtime checks as well as wide range of logical errors + + Determines preconditions on the inputs necessary to preclude runtime failures + Makes presumptions about return values of external subprograms + Identifies postconditions that characterize the range of outputs @@ -143,7 +143,7 @@ Integrated Analysis Engines + GNAT Warnings + Provides warning issued by GNAT compiler frontend - + Detects things like suspicious constructs and warnings when the compiler is sure an exception will be raised at run-time + + Detects things like suspicious constructs and warnings when the compiler is sure an exception will be raised at runtime + GNATcheck diff --git a/courses/gnatsas/sas_040_viewing_results.rst b/courses/gnatsas/sas_040_viewing_results.rst index 547872d7c..9b1722740 100644 --- a/courses/gnatsas/sas_040_viewing_results.rst +++ b/courses/gnatsas/sas_040_viewing_results.rst @@ -105,7 +105,7 @@ Message Kinds * Message kinds fall into one of the following categories * Warning - compilation warnings issued by GNAT front end - * Check - possible run-time check failures + * Check - possible runtime check failures * Informational - extra information about a message * Race Condition - messages about synchronization objects * Annotation - Information about a subprogram determined by analysis