Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion courses/gnatdas/010_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand All @@ -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
6 changes: 3 additions & 3 deletions courses/gnatdas/cover_010_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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...

Expand All @@ -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...

Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion courses/gnatdas/cover_030_advanced_topics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ xml
.. container:: latex_environment tiny

With exemptions

::

60% of 5 lines covered
Expand Down
33 changes: 1 addition & 32 deletions courses/gnatdas/labs/test_030_controlling_gnattest.lab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
-----------------------------------
Expand Down
4 changes: 3 additions & 1 deletion courses/gnatdas/test_020_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

::
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions courses/gnatdas/test_040_advanced_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
36 changes: 18 additions & 18 deletions courses/gnatsas/check_020_getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 0 additions & 2 deletions courses/gnatsas/check_040_lkql.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------------------------
Expand Down
2 changes: 1 addition & 1 deletion courses/gnatsas/sas_010_introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions courses/gnatsas/sas_020_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion courses/gnatsas/sas_040_viewing_results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down