It used to use the java set, there is Eclipse to get it. Now because I have to use Delphi to change an instant messaging software, I think about how to move the reconstruction and unit testing to Delphi. The book is said to the existing code plus unit test can deepen the understanding of the code, and can be used as a basis for improving the code. Is this not what I want to do? So, in order to build such a agile platform, I made a little attempt in Delphi2005 and Dunit, and record the results to the next, share it with you. 1. Download Delphi2005 Because Borland does not sell professional versions in China, given the architect and enterprise version of the high price, it can only download a D version from the network to do personal use. Delphi2005 is large, and update1 also needs CD, so it is recommended to download 2CD version with BT. The address of the seed is as follows: http://www.delphifans.com/softview/821.html 2, SP1 downloading Delphi2005 is said to be able to play after this patch, but this patch can be installed slowly, but also use CD. The download address is as follows: http://www.delphifans.com/softview/970.html 3, download dunit https://sourceForge.Net/Projects/dunit/ 4, install Delphi2005 SP1 Note that there is a register in Keygen and installation It is sure to install .NET and Win32 version of Delphi, C # Builder doesn't matter. Because if you only install the Win32 version will result in reconstruction (this is a bug of Delphi2005, the performance is an exception window that occurs when the .NET occurs when using reconstruction. 5, streamlined Delphi2005 is installed at the same time when the next step is installed, causing Delphi to start very slow. This can be implemented by modifying the registry, deleting some IDE packages. The specific approach is to add parameters -Rxxx after the shortcut target of Delphi, which is BDS.exe -Rxxx. This XXX is appointed by you, then you will find those dead packages in HKEY_CURRENT_USER / SOFTWARE / BORLAND / XXX (this is your selected name xxx) / 3.0/known IDE package. Be careful not to delete it too clean like Win32 purified molecules on the Internet, which is not used.
I have repeatedly tested many times after many times, "$ (bds) // bin // vclmenudesigner90.bpl" = "" $ (bds) // bin // Win32Debugproide90.bpl "= "(UnTID)" "$ (bds) // bin // htmide90.bpl" = "html designer package" "$ (bds) // bin // ipiDew3290.bpl" = "Borland Integrated Translation Environment for Win32" " (BDS) // bin // srcmanide90.bpl "=" "" $ (bds) // bin // Todoide90.bpl "=" BORLAND TODO "" $ (BDS) // bin // htmlhelp290.bpl "=" Borland HTMLHELP Viewer "" $ (bds) // bin // IdefileFilters90.bpl "=" IDE file filter "" $ (bds) // bin // startpageide90.bpl "=" Borland Start page IDE package " $ (Bds) // bin // refactoride90.bpl "=" borland core refactoring package "" $ (bds) // bin // dbkdebugide90.bpl "=" "" $ (bds) // bin // ExceptionDiag90.bpl "=" "" $ (bds) // bin // deployide90.bpl "=" deployment manager "" $ (bds) // bin // plugview90.bpl "=" Pluggable Tree View package " "$ (Bds) // bin // Coreproide90.bpl" = "Core IDE Pro Package" "$ (bds) // bin // odetools90.bpl" = "Build Tools" "$ (bds) // bin /// UnitTestide90.bpl "=" "" $ (bds) // bin // historyide90.bpl "=" "" $ (BDS) ) // bin // htmltidy90.bpl "=" html tidy formatter "" $ (bds) // bin // htmlfmt90.bpl "=" HTML INTERNAL FORMATTER "" $ (bds) // bin // mlcc90.bpl " = "Markup Language Code Completion Package" "$ (bds) // bin // DelphivClide90.bpl" = "Delphi VCl Designer IDE Package" "" $ (bds) // bin // DelphicoreProide90.bpl "=" (untric) "
"$ (Bds) // bin // Win32Debugide90.bpl" = "" "$ (bds) // bin // htmlide90.bpl" = "" "$ (bds) // bin // Delphide90.bpl "=" Delphi Win32 IDE Personality "" $ (bds) // bin // mtspro90.bpl "=" "" $ (bds) // bin // mtsent90.bpl "=" (Untitled) "" $ (Bds) // bin // ipelNet90.bpl "=" Borland Integrated Translation Environment for .NET "" $ (bds) // bin // NetimportWiz90.bpl "=" "$ (bds) //Bin//dataExplorer90.bpl"="(untip) "Although it is still a bit slow, it is finally endured. 6, compile and install DUNIT with you to compile DUNIT into DCU, put it into your specified directory. And add this directory to the library path of Tools-> Delphi Options-> Delphi Options-> library-win32 in Delphi. In addition, Dunit.exe is compiled 7. The way I recommend it is to write the Delphi program, and separate the interface and the background. It is to open two items, a normal VCL project, a DLL project. No, no, I mean is not letting you share the code with a DLL. This DLL project contains files for all backgrounds and tests on the background. The resulting DLL is used for DUNIT, and DUnit can read the test and run it. In fact, the project in the GUI section is included in all documents, which means that it is divided into two projects, but it is better to say that in the original single project, a DLL project specially used for testing is added. The project is divided into three: GUI, CORE, TESTCORE. Engineering includes GUI CORE, engineering two includes Core TestCore. The output of the project is the Win32EXE program. The project 2 output is a Win32DLL program. You can then put these two projects in a Project Group. 8. Writing test engineering one and ordinary writing DEPHI programs have no different, and remember to divide the GUI's function comes out of the background, let the background TESTABLE. The test is written in the secondary of the project, and I call the name of the project. The following is added to the core to add one of the most basic tests, check 1 1 is not equal to 2. Establish Testcase Unit Testbasic; Interface
Uses testframework;
TYPE TBASIC = Class Public Function Add (A, B: Integer): integer; end;
TTESTBASIC = Class (TTESTCase) Private Fbasic: TBASIC; Public Procedure Setup; Override; Published Procedure TestAdd;
IMPLEMentation
Function TBASIC.ADD (A, B: Integer): Integer; Begin Result: = A B; End; Procedure TTestBasic.Setup; Begin Fbasic: = TBASIC.CREATE;
Procedure ttestbasic.teardown; begin fbasic.free;
Procedure ttestbasic.testadd; begin checkequals (2, fbasic.add (1, 1));
Initialization RegisterTest ('', ttestbasic.suite);
End. Modify Core.BDsProj (Kao, what weird suffix) puts begin end. Change to Exports RegisteredTests Name 'Test'; END. Add TestFramework in the Uses section. Dunit is a function we registered in the DLL of this export. 9. Run DUNIT Add DUNIT to the Tools menu, which is convenient. Just fill in the parameters. I have no use of Macro inside, fill in the absolute path directly. If you fill in the absolute path like me, then you can see a test list directly from the Tools menu, and you will see a green light. If you don't add Dunit to the Tools menu, you will find the DLL, core.dll, which is compiled from the File-> Load Test's file selection window. ---- The reconstruction function and unit test are all. The rest is to add a test to the existing code, and then slowly refactor.