HTML Sanity Checker
Case Study for arc42
Architecture Documentation
https://github.com/aim42/htmlSanityCheck
(containing miserable source code by Gernot Starke)
Slide 19
Slide 19 text
Prerequisites
Required:
• Basic knowledge of HTML (link,
anchor, id, URI, ImageMap)
• Basic knowledge of Groovy +
Gradle
Disclaimer:
• System is seriously
over-documented
• Code is unfinished L
Slide 20
Slide 20 text
Intro and (Business) Goal
shall support authors
creating digital formats
with hyperlinks and
integration of images and
similar resources.“
1. Introduction and Goals
1.1 Requirements Overview
1.2 Quality Goals
1.3 Stakeholders
7.Deployment View
7.1 Infrastructure Level 1
7.2 Infrastructure Level 2
….
2. Constrainst
2.1 Technical Constraints
2.2 Organisational Constraints
2.3 Conventions
3. Context and Scope
3.1 Business Context
3.2 Technical Context
4. Solution Strategy
5. Building Block View
5.1 Level 1
5.2 Level 2
….
6. Runtime View
6.1 Runtime Scenario 1
6.2 Runtime Scenario 2
….
8. Crosscutting Concepts
8.1 Domain Structures and Models
8.2 Architectural/Design Patterns
8.3 Under the hood
8.4 User Experience
….
9. Architectural Decisions
9.1 Decision 1
9.2 Decision 2
….
10. Quality Requirements
10.1 Quality Tree
10.2 Quality Scenarios
11. Risks and technical debts
12. Glossary
>
Slide 21
Slide 21 text
Overview
Slide 22
Slide 22 text
Goal (Output)
HTML report
• Summary
• Results by page
• Minimally styled
Slide 23
Slide 23 text
Requirements (1): Checks
Slide 24
Slide 24 text
Architecture Quality Requirements
Priority Quality Goal Scenario
1 Correctness Every broken internal link (cross reference) is found
1 Correctness Every missing local image is found.
1 Safety Content of the files to be checked is never altered.
2 Correctness Correctness of every checker is automatically tested
for positive AND negative cases
3 Correctness Every reporting format is tested: Reports must
exactly reflect checking results.
3 Performance Check of 100kB html file performed under 10 secs
(excluding gradle startup)
Slide 25
Slide 25 text
Constraints
Implemented on Java platform
•Preferably in Groovy
Runnable as Gradle-plugin without installation*
* except: Java runtime
Available under liberal Open-Source license
1. Introduction and Goals
1.1 Requirements Overview
1.2 Quality Goals
1.3 Stakeholders
7.Deployment View
7.1 Infrastructure Level 1
7.2 Infrastructure Level 2
….
2. Constrainst
2.1 Technical Constraints
2.2 Organisational Constraints
2.3 Conventions
3. Context and Scope
3.1 Business Context
3.2 Technical Context
4. Solution Strategy
5. Building Block View
5.1 Level 1
5.2 Level 2
….
6. Runtime View
6.1 Runtime Scenario 1
6.2 Runtime Scenario 2
….
8. Crosscutting Concepts
8.1 Domain Structures and Models
8.2 Architectural/Design Patterns
8.3 Under the hood
8.4 User Experience
….
9. Architectural Decisions
9.1 Decision 1
9.2 Decision 2
….
10. Quality Requirements
10.1 Quality Tree
10.2 Quality Scenarios
11. Risks and technical debts
12. Glossary
Building Blocks
Hierarchy
Kontext
Level 1
Level 2
Level 3
H t ml S a n it y Check
use r
Bu ild sy st em (e.g .
G r adle, m ake)
loc al ht ml
file(s)
loc al i m ages
exter n al
websites &
resources
* Risk *
references
« p ost po n ed »
checks
checks
checks
references
H t ml S a n it y Check
loc al - ht ml loc al -i m ages
user
build - syste m
exter n al
websites
local - resources
HS C Co re
AllChecksRun ner
local file syste m
Results
ht t p
(exter n al)
HS C G r a d le
Plu gin
HSC Com m a n d
Lin e In t erfa ce
HS C G r a phic al
In t erfac e
done
pla n n ed
L
egend
via shell
HS C Co re
AllChecksRun ner
local file syste m
Results
ht t p
(exter n al)
«li br a r y »
H t ml P a rser
Results Collect o r
Fin d in g s
A ll Checks R un n e r
done
pla n n ed
L
egend
Ch ecker
Su ggest er
Re po r t e r
fin d
suggestions
crea te / execu te
1..
a d d Fin d in g
pa rse
Results
Results Collect o r
Results
Re po r t e r
Pe r - Ru n Results
Sin gle C heck Resu lts
w h a tIsC heck ed : St rin g
sourceIte m :St ring
t a r getIt em :St ri n g
n r OfIte msChecked :in t
Sin gle P age Resu lts
pageN a m e :St ring
pa geTit le :S t rin g
m et aInfo :PageMet aInfo
Fin d in g
it e m :S t rin g
sug gest ion :St rin g
Fin d in g s
a d d - Fin d in g
1.. *
0.. *
1
unused
i m ages
1
Classes:
AllChecksRunner
MissingConfigException
Packages:
o.a.h.check
o.a.h.collect
o.a.h.html
o.a.h.report
Classes:
Checker.groovy
ImageMapChecker
MissingImageFilesChecker