Git Repo Visualization and Log

This page shows the Git graphical repository visualization for Triangles, a Java project used to demo JUnit test cases for a simple problem.

Triangles Git Repo

graphical and text visualization of a git repo, using the git GUI

Triangles Git Repo Log (History)

wpollock@PollockHome ~/winhome/Documents/eclipse-workspace/Triangles
$ git mylog
Commit: 847b0fb, Parent(s): , Author: Wayne Pollock, Date: Sat Mar 7 18:35:03 2015 -0500
Initial Commit

Commit: 91a7978, Parent(s): 847b0fb, Author: Wayne Pollock, Date: Sat Mar 7 19:08:31 2015 -0500
First working version; bad argument checks not yet implemented.
Passes CheckStyle.

Commit: b06f685, Parent(s): 91a7978, Author: Wayne Pollock, Date: Sat Mar 7 20:38:21 2015 -0500
Initial JUnit test suite working (valid only test).

Commit: 02f0caf, Parent(s): b06f685, Author: Wayne Pollock, Date: Sun Mar 8 06:36:15 2015 -0400
Changed Integer.parseInt to the Java 8 Integer.parseUnsignedInt.
Finished legal and boundry value test cases.

Commit: 0d5755e, Parent(s): 02f0caf, Author: Wayne Pollock, Date: Mon Mar 9 18:15:12 2015 -0400
Added some bad test case methods, which currently fail!  The code will
be fixed at some point after the remaining (initial) test cases have
been written.

Commit: d3016f8, Parent(s): 0d5755e, Author: Wayne Pollock, Date: Tue Mar 10 01:33:24 2015 -0400
Tried alternative design for some test methods that were too long.  The
new design uses a data-driven approach, and seems to work well.

Commit: c77d1b3, Parent(s): d3016f8, Author: Wayne Pollock, Date: Tue Mar 10 02:49:51 2015 -0400
Test suite complete, although code still needs some clean up for
consistancy and readability.

Note, tests for invalid triangles, zero arguments, and illegal
arguments are failing.

Commit: 4723713, Parent(s): c77d1b3, Author: Wayne Pollock, Date: Sat Mar 14 21:42:24 2015 -0400
fixed up illegal number of arguments test.

Added reminder comments to refactor a number of methods, to show
the data in the error message.

Commit: 9bd9ebc, Parent(s): 4723713, Author: Wayne Pollock, Date: Sat Mar 14 21:43:30 2015 -0400
Added some todo comments

Commit: f4a9028, Parent(s): 9bd9ebc, Author: Wayne Pollock, Date: Thu Mar 26 03:36:33 2015 -0400
Moved the test suite out of the triangles package, into triangles_test.
Improved/removed some poor comments.
Fixed an incorrect test: The test for number too large for an int was
using Integer.MAX_INT-1.  It now uses Integer.MAX_VALUE + 1L.  Lesson:
test your test suite code!

Commit: e55815b, Parent(s): f4a9028, Author: Wayne Pollock, Date: Fri Apr 3 18:44:51 2015 -0400
Updated Triangles.java, to add checks for valid arguments.
(Note the second check added contains a deliberate error: possible
integer overflow.)

Commit: 1aa05ee, Parent(s): e55815b, Author: Wayne Pollock, Date: Sat Apr 4 07:41:43 2015 -0400
Refactored the tests a bit, and restyled the code a bit.
Changed the styles to comply with CheckStyle, only to discover
Eclipse style was different, and currently wrong (the indents).  It was
easier to turn off the Eclipse restyling on save than to fix the
formatter.  (One final refactoring should complete this project.)

Commit: 1b3c1ee, Parent(s): 1aa05ee, Author: Wayne Pollock, Date: Sat Apr 4 07:45:38 2015 -0400
Renamed triangles_test to trianglestest (checkstyle complained).

Commit: 64ca69f, Parent(s): 1b3c1ee, Author: Wayne Pollock, Date: Sun Apr 5 02:58:25 2015 -0400
Final version of the test suite.
Note Triangle.classify still contains a deliberate logic error on line
61.  The correct test (to avoid possible integer overflow) should be:
    if (side[0] <= side[2] - side[1] ) {

Commit: df9d04a, Parent(s): 64ca69f, Author: Wayne Pollock, Date: Mon Jan 4 04:57:33 2016 -0500
Fixed Unit tests, code bug.
I simplified the unit tests that fail from assertTrue("...", false) to
just fail("...").

Noticed a failing test today that I somehow missed before!  Using int to
hold unsigned types is fine, but Arrays.sort(int[]) isn't in on the
joke.  As a result, it mis-sorts the array.  The fix was to make an
array of long to hold the (unsigned) integers.  All tests pass now.
(I suspect the older JRE simply sorted differently.)


Commit: 20635b5, Parent(s): df9d04a, Author: Wayne Pollock, Date: Fri Mar 31 16:28:40 2017 -0400
Added demo test showing how to test whole programs.

When an app isn't designed for testing, you can simply run it
and collect the output using ProcessBuilder.  Since the setup is
non-trivial, an extra test was added to show how.

Added a comment about designing for testability to Triangles.java
as well.

The above Git command used an alias.  Here's how I defined the alias and a custom log format, in my .gitconfig file:

$ # Create custom log format, use with alias command:
$ git config --global pretty.myfmt \
   'Commit: %h, Parent(s): %p, Author: %an, Date: %ad%n%B%n'
$ git config --global alias.mylog \
   'log --pretty=myfmt --full-history --branches --reverse'

$ cat .gitconfig
[user]
        name = Wayne Pollock
        email = pollock@acm.org
[core]
        safecrlf = false
[merge]
        tool = vimdiff
[pretty]
        myfmt = Commit: %h, Parent(s): %p, Author: %an, Date: %ad%n%B%n
[alias]
        mylog = log --pretty=myfmt --full-history --branches --reverse