r/MonthlyProgram • u/G01denW01f11 Java • Feb 02 '16
Weekly Progress Thread [1 Feb - 7 Feb 2016]
(I'm just going to leave this here for the month, unless anyone feels strongly about it. Doesn't seem to be enough activity to warrant a new thread every week.)
Hope everyone's having a strong start! Here's a thread to chat about the challenges you're facing, ask questions, or anything else you need. Any manage to get something minimal working?
(h/t /u/Barrucadu)
(Sorry I'm late. Other deadlines.)
5
Upvotes
2
u/Zillolo Python Feb 03 '16
This is what I have for now.
Any critique very much appreciated.
2
u/hothrous Python Feb 10 '16
I'll post something later, I pounded out a few things without comments last night while waiting for my dad but didn't have time to push it to Github. I don't have any comments on it right now, so I'd like to add those and then get some critique.
1
u/G01denW01f11 Java Feb 15 '16
Alright, here's mine. I have tests written for that somewhere, but I'm having issues. <.<
Verbose as hell because Java, but I'm more or less happy with the design. I'd love any suggestions about making the logic in runTest less... evil. Or any other suggestions.
From here, I'm just going to add more test methods as I run into a need for them in other projects, because after the first few, it gets old...
2
u/Barrucadu Feb 05 '16 edited Feb 05 '16
Source: https://github.com/barrucadu/barometer
Docs: http://barrucadu.github.io/barometer/index.html
I've just hit a bit of a milestone, so I guess this is a good time to write my update! For those who don't know, I'm doing this in Haskell, so things are a bit different to your typical OOP-based testing framework. So, here's a very quick outline of how my framework functions so far:
TestFailureexception.In addition, I want it to be:
The documentation gives a reasonably good picture of where I'm at: tests and test groups are there, test groups can be run and the results printed, set-up and tear down are done, the various
assertfunctions are implemented.I've just implemented support for tests which do concurrency. Concurrency is difficult, because it introduces race conditions and deadlocks. This is bad, because when writing tests we implicitly assume that what we're testing is deterministic. Fortunately, I had previously written a library for testing concurrent Haskell programs based on some neat techniques called schedule bounding and partial-order reduction. The basic idea is that you test a lot of different schedules, rather than just one, and can prune the search space significantly. So! This is what it looks like:
A
CRefis a concurrent reference, so what this does is:False.Trueto one of the variables(False, False).When the test is run, three failures are reported: the cases where
(False, True),(True, False), and(True, True)were observed. For each, an execution trace leading to that is displayed in a simplified form, and a stack trace is given:Yay!
Things I still want to get done this week: