comp.lang.ada
 help / color / mirror / Atom feed
* Ann: ArchiCheck v0.1
@ 2017-06-07 22:06 Lionel Draghi
  2017-06-08  1:04 ` Randy Brukardt
  2017-06-08  7:29 ` Ann: " Simon Wright
  0 siblings, 2 replies; 6+ messages in thread
From: Lionel Draghi @ 2017-06-07 22:06 UTC (permalink / raw)


Hi all,

Archicheck is a simple tool to describe and enforce architecture/design 
decision that are not easily checked by languages and compilers.

This code was written twelve years ago, and even announced on 
comp.lang.ada 
(http://groups.google.com/group/comp.lang.ada/browse_thread/thread/4a195a443fce793e/41bb2cb527464bab?q=comp.lang.ada+example+of+layered+software#41bb2cb527464bab) 
in November 2005, but never released.

Here it is, essentially as it was in 2005, build in the same environment 
(Darcs, Gnat, NaturalDocs, Dia, OpenToken, etc.).

This tool was written because of my frustration that simple design 
decision where not complied with.
A classical and recurring case was that for a bug fix, someone adds a 
“with” in the code, that created a visibility to a package supposed to 
be in an upper layer.
(Refer to slides 5 to 8 in this 2004 (!) pdf : 
http://lionel.draghi.free.fr/ArchiCheck/Doc/Archicheck Overview.pdf for 
a graphical view of this).

Few month of such a code spaghettization resulted in subtle elaboration 
order problems, and obviously in code degradation. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


Another classical design decision not so easy to verify is to forbid any 
dependencies on OS specific code, except in an appointed “portability” 
package.

Ada couldn’t prevent this (not to mention other languages), and I found 
no external tools able to verify it.

This is why I started the Archicheck project, as a tool that read a text 
file containing in simple statements the architecture description, and 
check the code compliance.

Consider the my_rules.txt file :
    Presentation_Layer contains A B C packages
    Application_Layer contains D E F packages
    Domain_Layer contains G H I packages

    Presentation_Layer is a layer over Application_Layer
    Application_Layer is a layer over Domain_Layer

    Only Hardware_Abstraction_Layer can use Interfaces.C

Just put
    archicheck my_rules.txt –I ./my_src

in your make file, and that’s it.

This is a POC, the code is not at all robust, or even well tested, and 
it check only Layer rules at this stage (cf. Tests section here : 
http://lionel.draghi.free.fr/Archicheck/index.html).

Any feedback or comment is welcomed (even on the tool’s name!).

More info on http://lionel.draghi.free.fr/Archicheck/index.html

Lionel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ArchiCheck v0.1
  2017-06-07 22:06 Ann: ArchiCheck v0.1 Lionel Draghi
@ 2017-06-08  1:04 ` Randy Brukardt
  2017-06-08 10:33   ` lionel.draghi
  2017-06-08  7:29 ` Ann: " Simon Wright
  1 sibling, 1 reply; 6+ messages in thread
From: Randy Brukardt @ 2017-06-08  1:04 UTC (permalink / raw)


"Lionel Draghi" <Lionel.nospam.Draghi@Ada-France.org> wrote in message 
news:593878c9$0$3316$426a74cc@news.free.fr...
...
> Another classical design decision not so easy to verify is to forbid any 
> dependencies on OS specific code, except in an appointed "portability" 
> package.

pragma Profile (No_Implementation_Extensions);

forbids any dependence on implementation-defined stuff. That eliminates most 
(not all) sources of non-portable code, it clearly includes target-dependent 
packages like Ada.Directories.Information. See 13.12.1(9-13/3). By far the 
best way to avoid OS-specific code is to stick to the language-defined 
packages!

Of course, you could use an OS-Dependent package of your own design (or one 
picked up off the Internet), and the language can't possibly help with that. 
So your tool certainly has value beyond what the language (any language for 
that matter) can do.

                                    Randy.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ann: ArchiCheck v0.1
  2017-06-07 22:06 Ann: ArchiCheck v0.1 Lionel Draghi
  2017-06-08  1:04 ` Randy Brukardt
@ 2017-06-08  7:29 ` Simon Wright
  2017-06-08 10:21   ` Lionel
  1 sibling, 1 reply; 6+ messages in thread
From: Simon Wright @ 2017-06-08  7:29 UTC (permalink / raw)


Lionel Draghi <Lionel.nospam.Draghi@Ada-France.org> writes:

> (Refer to slides 5 to 8 in this 2004 (!) pdf :
> http://lionel.draghi.free.fr/ArchiCheck/Doc/Archicheck Overview.pdf
> for a graphical view of this).

I get a 404 with this (both with Safari and wget).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ann: ArchiCheck v0.1
  2017-06-08  7:29 ` Ann: " Simon Wright
@ 2017-06-08 10:21   ` Lionel
  0 siblings, 0 replies; 6+ messages in thread
From: Lionel @ 2017-06-08 10:21 UTC (permalink / raw)


Le jeudi 8 juin 2017 09:29:56 UTC+2, Simon Wright a écrit :
> Lionel Draghi <Lionel.nospam.Draghi@...> writes:
> 
> > (Refer to slides 5 to 8 in this 2004 (!) pdf :
> > http://lionel.draghi.free.fr/ArchiCheck/Doc/Archicheck Overview.pdf
> > for a graphical view of this).
> 
> I get a 404 with this (both with Safari and wget).

Oups, 
here is the good one : http://lionel.draghi.free.fr/ArchiCheck/Archicheck_Overview.pdf
thanks,
Lionel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ArchiCheck v0.1
  2017-06-08  1:04 ` Randy Brukardt
@ 2017-06-08 10:33   ` lionel.draghi
  2017-06-09  3:27     ` Randy Brukardt
  0 siblings, 1 reply; 6+ messages in thread
From: lionel.draghi @ 2017-06-08 10:33 UTC (permalink / raw)


Le jeudi 8 juin 2017 03:04:56 UTC+2, Randy Brukardt a écrit :
...
> pragma Profile (No_Implementation_Extensions);

Thank you Randy for the update.
This is my first contact with Ada 2012, as I am out of the programming field since 2007.
I plan to read this week-end some overview to discover the gems of Ada 2012.

Lionel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ArchiCheck v0.1
  2017-06-08 10:33   ` lionel.draghi
@ 2017-06-09  3:27     ` Randy Brukardt
  0 siblings, 0 replies; 6+ messages in thread
From: Randy Brukardt @ 2017-06-09  3:27 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

<lionel.draghi@gmail.com> wrote in message 
news:1b5ff139-fc0d-4c36-8298-2cde80ecc70e@googlegroups.com...
Le jeudi 8 juin 2017 03:04:56 UTC+2, Randy Brukardt a écrit :
...
>> pragma Profile (No_Implementation_Extensions);
>
>Thank you Randy for the update.
>This is my first contact with Ada 2012, as I am out of the programming 
>field since 2007.
>I plan to read this week-end some overview to discover the gems of Ada 
>2012.

You have lots of reading ahead!!

Another item that would help for this sort of thing is
    pragma Restrictions (No_Dependence, <some package name>);
which prevents any use of the named package (which doesn't actually have to 
exist anywhere).

For instance,
    pragma Restrictions (No_Dependence, GNAT);
prevents any use of package GNAT or any of its children in your program. 
(Which will get rid of a lot of GNAT-defined facilities.)

In your case, one can use it to prevent using various locally defined 
packages that might not  be portable.

                                   Randy.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-06-09  3:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-07 22:06 Ann: ArchiCheck v0.1 Lionel Draghi
2017-06-08  1:04 ` Randy Brukardt
2017-06-08 10:33   ` lionel.draghi
2017-06-09  3:27     ` Randy Brukardt
2017-06-08  7:29 ` Ann: " Simon Wright
2017-06-08 10:21   ` Lionel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox