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
Solved

DUnit - Appropriate use??

Posted on 2004-08-23
3
205 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
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…

839 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