Domain-Specific Program Checking
-
Upload
lukas-renggli -
Category
Technology
-
view
681 -
download
3
description
Transcript of Domain-Specific Program Checking
Domain-Specific Program Checking
Lukas Renggli, Stéphane Ducasse, Tudor Gîrba, Oscar Nierstrasz
Web Application Framework
14000
16000
18000
Sea
sid
e 2.
6
Sea
sid
e 2.
7
Sea
sid
e 2.
8
Sea
sid
e 2.
8.1
Sea
sid
e 2.
8.2
Sea
sid
e 2.
8.3
Sea
sid
e 2.
9a1
Sea
sid
e 2.
9a2
Sea
sid
e 2.
9a3
LOC
1
2
3
4
Lint
14000
16000
18000
Sea
sid
e 2.
6
Sea
sid
e 2.
7
Sea
sid
e 2.
8
Sea
sid
e 2.
8.1
Sea
sid
e 2.
8.2
Sea
sid
e 2.
8.3
Sea
sid
e 2.
9a1
Sea
sid
e 2.
9a2
Sea
sid
e 2.
9a3
LOC
1
2
3
4
Lint
???
14000
16000
18000
Sea
sid
e 2.
6
Sea
sid
e 2.
7
Sea
sid
e 2.
8
Sea
sid
e 2.
8.1
Sea
sid
e 2.
8.2
Sea
sid
e 2.
8.3
Sea
sid
e 2.
9a1
Sea
sid
e 2.
9a2
Sea
sid
e 2.
9a3
LOC
<a href="...">Remove Task 1</a> <br /><a href="...">Remove Task 2</a> <br /><a href="...">Remove Task 3</a> <br />
renderTasksOn: html tasks do: [ :task | html anchor with: 'Remove Task ' , task number; callback: [ tasks remove: task ]. html break ]
renderTasksOn: html tasks do: [ :task | html anchor with: 'Remove Task ' , task number; callback: [ tasks remove: task ]. html break ]
Modifies collection while iterating over it
‣ HTML generation
‣ Javascript generation
‣ Composition definition
‣ Control flow
‣ Application configuration
Internal Domain-Specific Languages
1
2
3
4
Lint
???
14000
16000
18000
Sea
sid
e 2.
6
Sea
sid
e 2.
7
Sea
sid
e 2.
8
Sea
sid
e 2.
8.1
Sea
sid
e 2.
8.2
Sea
sid
e 2.
8.3
Sea
sid
e 2.
9a1
Sea
sid
e 2.
9a2
Sea
sid
e 2.
9a3
LOC
Generic (Lint)Program Checker
Generic (Lint)Program Checker
ArchitectureChecker
Generic (Lint)Program Checker
Domain-SpecificProgram Checker
ArchitectureChecker
30 Domain-Specific Rules
‣ Possible Bugs
‣ Bad Style
‣ Suboptimal Code
‣ Non-Portable Code
renderTasksOn: html tasks do: [ :task | html anchor with: 'Remove Task ' , task number; callback: [ tasks remove: task ]. html break ]
#with: has to be last message in cascade
renderTasksOn: html tasks do: [ :task | html anchor callback: [ tasks remove: task ]; with: 'Remove Task ' , task number. html break ]
1
2
3
4
Lint
14000
16000
18000
Sea
sid
e 2.
6
Sea
sid
e 2.
7
Sea
sid
e 2.
8
Sea
sid
e 2.
8.1
Sea
sid
e 2.
8.2
Sea
sid
e 2.
8.3
Sea
sid
e 2.
9a1
Sea
sid
e 2.
9a2
Sea
sid
e 2.
9a3
LOC
1
2
3
4
Lint
Slime
14000
16000
18000
Sea
sid
e 2.
6
Sea
sid
e 2.
7
Sea
sid
e 2.
8
Sea
sid
e 2.
8.1
Sea
sid
e 2.
8.2
Sea
sid
e 2.
8.3
Sea
sid
e 2.
9a1
Sea
sid
e 2.
9a2
Sea
sid
e 2.
9a3
LOC
Designed for
Framework Development
Now used for
Application Development
69% developers state
“Slime produces more relevant results than Lint”
81% developers state
“Slime helped me to detect critical bugs”
Generic (Lint)Program Checker
Domain-SpecificProgram Checker
ArchitectureChecker
Magritte Metamodel
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* description
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* descriptionmodel
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* descriptionmodel
metamodel
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* descriptionmodel
metamodel
<<described by>>
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* descriptionmodel
metamodel
<<described by>>
meta-metamodel
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* descriptionmodel
metamodel
<<described by>>
meta-metamodel<<described by>>
Person class>>descriptionUsername ^ StringDescription new accessor: #username; beRequired; default: nil; yourself
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* description
Description class>>descriptionLabel ^ StringDescription new accessor: #label; label: ‘Label’; beRequired; yourself
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* description
Generic (Lint)Program Checker
Domain-SpecificProgram Checker
ArchitectureChecker
Generic (Lint)Program Checker
Domain-SpecificProgram Checker
ArchitectureChecker
Domain-SpecificModel Checker
Person class>>descriptionUsername ^ StringDescription new accessor: #username; beRequired; default: nil; yourself
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* description
Person class>>descriptionUsername ^ StringDescription new accessor: #username; label: ‘Username’; beRequired; default: nil; yourself
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* description
Person class>>descriptionUsername ^ StringDescription new accessor: #username; label: ‘Username’; beRequired; default: nil; yourself
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* description
#label is a required value
Invalid default value
Person class>>descriptionUsername ^ StringDescription new accessor: #username; label: ‘Username’; beRequired; default: nil; yourself
Personusernamebirthday
Description
accessorlabelrequiredpriority
*
description
* description
70000 Lines of Code
1100 Classes
300 Described Classes
12000 Methods
70000 Lines of Code
1100 Classes
300 Described Classes
12000 Methods
500 Magritte Issues
Implementation
Extends existing Program-Checker
Parse Tree Matching
scg.unibe.ch/research/helvetia
DeclarativeRule System
Generic (Lint)Program Checker
Domain-SpecificProgram Checker
ArchitectureChecker
Domain-SpecificModel Checker
Domain-SpecificProgram Checking