- Created by Anton Kronseder, last modified by Robert Reiner on 05. Feb 2016
Provides a static decomposition of the system into building blocks and the relationships between them.
- Name
- Building Block View
- Parent
- Iteration
- Filled
Whiteboxes Level 1
Components of HTML Sanity Checker - Whitebox
Diagram
Blackboxes
Building Block | Description |
---|---|
CheckerCore | core: html parsing and sanity checking, file handling |
HSC Command Line Interface | (not documented) |
HSC Gradle Plugin | integrates the Gradle build tool with HtmlSC, enabling arbitrary gradle builds to use HtmlSC functionality. |
HSC Graphical Interface | (planned, not implemented) |
Reporter | outputs the collected checking results to configurable destinations, e.g. StdOut or a Html file. |
Description
We used functional decomposition to separate responsibilities:
- CheckerCore shall encapsulate checking logic and Html parsing/processing.
- all kinds of outputs (console, html-file, graphical) shall be handled in a separate component (Reporter)
- Implementation of Gradle specific stuff shall be encapsulated.
Internal Interfaces
Interface | Description |
---|---|
build system | currently restricted to Gradle: The build system uses HtmlSC as configured in the buildscript. |
local-html and local-images | HtmlSC needs access to several local files, especially the html page to be checked and to the corresponding image directories. |
usage via shell | arc42 user uses a command line shell to call the HtmlSC |
Blackboxes Level 1
CheckerCore
Description
Checker contains the core functions to perform the various sanity checks. It parses the html file into a DOM-like in-memory representation, which is then used to perform the actual checks.Purpose
core: html parsing and sanity checking, file handlingProvided Interfaces
Interface (From-To) | Description |
---|---|
Command Line Interface → Checker | Exposes the #AllChecksRunner class, as described in AllChecksRunner. |
Gradle Plugin → Checker | Exposes HtmlSC via a standard Gradle plugin, as described in the Gradle user guide. |
Files
org.aim42.htmlsc.AllChecksRunner
org.aim42.htmlsc.HtmlSanityCheckGradlePlugin
HSC Command Line Interface
Purpose
(not documented)HSC Gradle Plugin
Purpose
integrates the Gradle build tool with HtmlSC, enabling arbitrary gradle builds to use HtmlSC functionality.HSC Graphical Interface
Purpose
(planned, not implemented)Reporter
Purpose
outputs the collected checking results to configurable destinations, e.g. StdOut or a Html file.Whiteboxes Level 2
CheckerCore - Whitebox
Diagram
Blackboxes
Building Block | Description |
---|---|
[ResultsCollector] | Collects all checking results. Its interface Results is contained in the whitebox description |
AllChecksRunner | Facade to the different Checker instances. Provides a (parameter-driven) command-line interface. |
Checker | abstract class, used in form of the template-pattern. Shall be subclassed for all checking algorithms. |
HtmlParser | Encapsulates html parsing, provides methods to search within the (parsed) html. |
Description
This structures follows a strictly functional decomposition:
- parsing and handling html input
- checking
- collecting checking results
Blackboxes Level 2
[ResultsCollector]
Purpose
Collects all checking results. Its interface Results is contained in the whitebox descriptionAllChecksRunner
Purpose
Facade to the different Checker instances. Provides a (parameter-driven) command-line interface.Checker
Description
The abstract Checker provides a uniform interface (public void check()) to different checking algorithms. It is based upon the concept of extensible checking algorithms.
Purpose
abstract class, used in form of the template-pattern. Shall be subclassed for all checking algorithms.HtmlParser
Purpose
Encapsulates html parsing, provides methods to search within the (parsed) html.Whiteboxes Level 3
[ResultsCollector] - Whitebox
Diagram
Blackboxes
Building Blocks | Description |
---|---|
Finding | a single finding, (e.g. "image 'logo.png' misssing"). Can hold suggestions and (planned for future releases) the responsible html element. |
Per-Run Results | results for potentially many Html pages/documents. |
Single-Check-Results | results for a single type of check (e.g. missing-images check) |
Single-Page-Results | results for a single page |
Description
This structures follows the hierarchy of checks - namely managing results for:
- a number of pages/documents, containing:
- a single page, each containing many
- single checks within a page
Internal Interfaces
Interface | Description |
---|---|
Results | The Result interface is used by all clients (especially Reporter subclasses, graphical and command-line clients) to access checking results. It consists of three distinct APIs for overall RunResults, single-page results (PageResults) and single-check results (CheckResults). |
Blackboxes Level 3
Finding
Purpose
a single finding, (e.g. "image 'logo.png' misssing"). Can hold suggestions and (planned for future releases) the responsible html element.Per-Run Results
Purpose
results for potentially many Html pages/documents.Single-Check-Results
Purpose
results for a single type of check (e.g. missing-images check)Single-Page-Results
Purpose
results for a single page