Solved

DUnit - Appropriate use??

Posted on 2004-08-23
3
207 Views
Last Modified: 2010-04-05
Hi folks,

I've been asked to look at DUnit for one of our existing projects, and I'm not really convinced it's going to be something that'll be easy to implement.

The project in question has around 200,000 lines of code in it.  It's not based around any object oriented code at all (in fact, there is a ton of Delphi 1 legacy code still in it).  There is a heap of inter-form dependencies - which may or may not be there depending on the way the method is called.  So, we could have a component on Form2 that we're using, but only if the method is called in that particular way.  Call it another way, and form2 may not even be looked at (or there for may not even be in memory).

Also, a single function may return many different results based on how it was initially called.  What this means is, within the function, a set of different parameters are checked, and depending on those parameters, different formulas/actions are used which in turn returns a different result.

It's pretty much a dogs breakfast of code.  It's been tacked onto for years now, and it's at the point now were changing something can bugger up other things due to it's heavy dependencies on shared stuff (that's bad sharing, not good sharing).  The person who recommended we use DUnit believe that we can use it to fix some of these problems.  I believe adding it into the program will just introduce even more issues and possibly won't work anyway due to the dependency issues.

Does anyone have any thoughts at all?  I know it needs to be rewritten - and it will be.  None of us have used DUnit before.

Any info greatly appreciated.

Stuart.
0
Comment
Question by:Stuart_Johnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 11878550
Hello

  I have never used DUnit for any projects, but these links maybe help you

http://www.elvenware.com/charlie/delphi/
http://www.thedelphimagazine.com/samples/1339/1339.htm

HTH
0
 

Accepted Solution

by:
jschmied earned 250 total points
ID: 11879065
Hallo!

I would not see much gain from writing DJunit tests for such a project.

If you start a new development, try it in the following way:
1. - try to construct your business logic as a clean set of objects, write only the empty objects at this time
2. - define your requirements to the business logic as JUnit test cases
3. - implement the testcase
4. - implement the businesslogic

loop throu 2..4 until you are ready

Such a development helps to get a clean implementation.

Bye

Juergen


0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 11886975
Hi Juergen,

That's what I thought too.  Thanks for that.

Thanks for the links too, mnasman.

Stu.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question