Diff Tool Exercises

Published on January 7, 2025
Diff Tool Exercises

Paid subscribers get to play with these exercises together. Join us, Friday 10 January at 1pm, on Zoom.

diff compares two files, highlighting differences. Here's how diff can work for testers. On that page, you'll find links to several tools that implement and build on diff – you may already have your own preference.

In this exercise, you’ll use any diff tool that seems right to you.

This exercise is more fun in a group. If you’re in a group, please talk about what tool you’d use. Perhaps re-run the exercise with someone else’s tool of choice, or with someone else.

The solutions are below. The tool will do most of the work – give yourself kudos for spotting non-trivial things. Zero kudos if you look at the solutions before trying the exercises.

Exercises Group 1 – XML

Download the linked files, use them in a tool.

If you’re opening the file in a browser, finding out what an xmlschema is, and reading through it, you’re doing it …differently from how I’d expect you to do it.

Exercise 1.1

 file 1file 2

Solution

Exercise 1.1 - Lines Removed

in the schema definition, v2 is missing these lines, location 453 in original



Exercise 1.2

 file 1file 2

Solution

Exercise 1.2 - Lines Added

In the schema definition, v2 has had line 699 duplicated in error

Exercise 1.3

 file 1file 2

Solution

Exercise 1.3 - Lines Rearranged

In the schema definintion on lines 224 to 234 of v2, SimpleType DocumentType2Code has been rearranged. Kudos if you recognised that it has been sorted












Exercise 1.4

 file 1file 2

Solution

Exercise 1.4 Information Changed On A Single Line

In the schema definition on line 463, the order of attributes has been rearranged. Kudos if you noticed that maxOccurs has changed from 4 to 5


Exercise 1.5

file 1file 2

Solution

EXERCISE 1.5 - LINES SPLIT

In the schema definition on line 165, the line has been split by tag.

Kudos if you noticed that there’s an extra attribute base, that the tag is no longer closed with /> but ends with a >, and that the name attribute is now ccy rather than Ccy


Exercise 1.6

file 1file 2

Solution

Exercise 1.6 - Lines Joined

In the schema definition, line 278 has been joined with line 279. Kudos if you noticed the spelling of elemnet, the absence of capitalisation in both pairs of maxoccurs and minoccurs, and at least one spellign error.


«JL: Add more, in JSON and CSV and TXT (i.e. dir list)»

Exercises Group 2 – Code and config

Python, JavaScript, YAML/TOML, env

Exercises Group 3 – Markdown

Docs and readme.

Exercises Group 3 – Folders

Changed content, added / removed, renamed / moved, timestamp, permissions, ?encoding, ?os-specific metadata, ?hash,

Exercises Group 4 – Combos

sort / grep / filter – first, within git and across files for a commit, on directory / process lists, getting unique / count of changes,


This page is a work in progress. I'm sure that a curious reader can easily find my notes to myself. «JL: perhaps, if the script finds any notes, it can insert this message?»