Automated Testing DITA Content and Customizations
-
Upload
steve-anderson -
Category
Technology
-
view
437 -
download
0
Transcript of Automated Testing DITA Content and Customizations
![Page 1: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/1.jpg)
Automated Testing DITA Content and CustomizationsSteven AndersonInformation Architect
@sanderson_sfdc
![Page 2: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/2.jpg)
What is testing?
Testing is the process of validating and verifying that your
project:– meets the requirements that guided its design and development
– works as expected
![Page 3: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/3.jpg)
What types of testing are there?
Regression testing
Acceptance testing
Alpha and beta testing
![Page 4: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/4.jpg)
How can we meet our test objectives?
Manual testing
Automated testing
![Page 5: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/5.jpg)
What is manual testing?
Visual inspection
Click that link!
Expand the table of contents
![Page 6: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/6.jpg)
What is automated testing?
Use software to run the tests
Compare actual output to expected output
Report on the state of the content or output
![Page 7: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/7.jpg)
Let's learn from software development
Use manual testing only when required
Depend on automated testing
![Page 8: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/8.jpg)
What are the limitations of manual testing?
Time consuming
Error prone
Is that an error or not?
![Page 9: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/9.jpg)
Why is automated testing a good choice?
It gives you confidence that you haven't made that mistake
– again
It scales
It finds unintended side-effects
![Page 10: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/10.jpg)
Automated testing and DITA
![Page 11: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/11.jpg)
With DITA there are three things to test
Content (the input)
The OT itself
The output
![Page 12: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/12.jpg)
How can you test your content?
Schematron
QA plugin
XMLUnit
![Page 13: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/13.jpg)
What is schematron?
A rule based validation language for making assertions
about the presence or absence of patterns in XML trees
Many authoring tools use schematron
http://www.schematron.com/
![Page 14: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/14.jpg)
Demo of schematron in oxygen
![Page 15: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/15.jpg)
What’s the QA plugin?
Created by D.P. Clark and Patrick Quinlan
Identifies errors in DITA tagging, element nesting, language
standards, and common syntax errors
Default tests based on styles in the Microsoft Manual of
Style for Technical Publications
An HTML report is created that includes links to each
project topic file
Tests written in XSLT
http://sourceforge.net/p/qa-plugin-dot/wiki/Home/
![Page 16: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/16.jpg)
Demo of the QA Plugin
![Page 17: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/17.jpg)
What is XMLUnit?
XMLUnit enables assertions to be made about the content
and structure of XML
Based on Junit
http://xmlunit.sourceforge.net/
![Page 18: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/18.jpg)
Demo of XMLUnit
![Page 19: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/19.jpg)
How can you test the OT?
OT regression test suite
JUnit
![Page 20: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/20.jpg)
DITA OT Regression Test
A large number of sample DITA maps and topics
representing a wide variety of content, as well as batch files
to run the content through a build
The output of the test is compared to the output of the
previous working set of code to determine if any tests fail or
if any output changes in a negative way
Mostly useful when customizing, or when upgrading,
versions of the OT
http://dita.xml.org/wiki/regression-testing-in-the-toolkit
![Page 21: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/21.jpg)
Demo of DITA OT Regression Test
![Page 22: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/22.jpg)
How can you test the output?
Link tests
XMLUnit
Browser automation - Selenium, Silk, etc.
Needle and nose
![Page 23: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/23.jpg)
Browser automation
Automate tests using browsers
http://seleniumhq.org/ and
http://www.borland.com/us/products/silk/silktest/
![Page 24: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/24.jpg)
Demo of Selenium
![Page 25: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/25.jpg)
Needle and Nose
Unit testing using Python
Nose is the test framework, needle does the comparison
For testing HTML output
http://needle.readthedocs.org/en/latest/index.html
![Page 26: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/26.jpg)
Demo of Needle and Nose
![Page 27: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/27.jpg)
Samples and code available athttps://github.com/saanvik/Automated-Testing-for-DITA-OT
![Page 28: Automated Testing DITA Content and Customizations](https://reader033.fdocuments.net/reader033/viewer/2022052622/5595af181a28abf23d8b4620/html5/thumbnails/28.jpg)