Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: API vc MVC Date: Sat, 1 Aug 2015 10:13:48 +0000 (UTC) Organization: A noiseless patient Spider Lines: 42 Message-ID: References: <6a96955c-6b2a-416e-9be1-8c5bcc12ff3e@googlegroups.com> <7ff2e384-40c8-48d3-bb27-4f4ec2e6e147@googlegroups.com> <55bae330$0$297$14726298@news.sunsite.dk> <55bb73ad$0$2873$e4fe514c@news.xs4all.nl> <55bc0612$0$293$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 1 Aug 2015 10:13:48 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="6584"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tRWlnWub+/1A1Piu9qaP+mS6kpxeHpic=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:/yt3L2g22c6XF/AmGQszcuDixBo= Xref: csiph.com comp.lang.java.programmer:32238 On Sat, 01 Aug 2015 05:39:12 +0100, Eternal Hope wrote: > I stick to plain vanilla when I can and I don't mind admitting it and > there's not much I can't do, in fact I can't think of anything I can't > do and I don't need a framework to do it. My SQL is spare, and usually > works OOTB, my java compiles first time. Years of practice and studious > avoidance of frameworks. > > Give me a basic text editor, a terminal and a runtime and compiler and > I'm good to go > Yep. I see no need for JUnit either: having used it, I wasn't impressed with the appearance or content of the test results. Instead I prefer to script rather than program my unit/regression tests, though I admit this probably shows a bias toward the UNIX way of doing things rather than the Windows way. My approach is simple: one driver class I wrote years ago that reads the script, splits non-comment lines into words (function name followed by argument list the comments describe expected results), and passes the function name and arguments to an interface class which is little more than an if..then..else totem pole and is specific to the class(es) that the script tests. When run, the output is the script with interspersed results, i.e. something thats easily readable. Regression tests? Simple: a bash script that diffs the output against saved good output from a previous run. If there's any output from diff, the regression test failed. This approach is not only dead simple, its fast too. Even scripts containing several tens of test cases typically run in well under a second, so its practical to run a suite of regression tests after every successful compile to prove that the last changes didn't break anything. I use the same approach for C development. Also, because the test harnesses have very few dependencies, its entirely practical to distribute them with the source so anybody can use the regression tests to check that they have successfully compiled and installed the code. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |