标签: bold-delphi

ORM for DELPHI win32

有没有人知道ORM或类似的Delphi Win32.

delphi orm bold-delphi

32
推荐指数
6
解决办法
2万
查看次数

当使用Bold编写Delphi框架时,提高可测试性

背景 我在一个由7名开发人员和2名测试人员组成的团队中工作,这些团队负责物流系统.我们使用Delphi 2007和模拟驱动开发与Bold for Delphi作为框架.该系统现已投入生产约7年,拥有约1,700万行代码.我们在4-5周后发布到生产,几乎每次发布后我们都要为我们没有找到的bug做一些补丁.这对我们和客户来说当然都很烦人.

当前测试 解决方案当然是更自动化的测试.目前我们有手动测试.一个Testdbgenerator,以空数据库开头,并从建模方法中添加数据.我们还有Testcomplete,它运行一些非常基本的脚本来测试GUI.缺乏时间阻止我们添加更多测试,但脚本对应用程序中的更改也很敏感.几年前我真的尝试用DUnit进行单元测试,但是几天后我放弃了.这些单位的联系太紧.

单元测试前提条件 我认为我知道单元测试的一些前提条件:

  • 编写做一件事的小方法,但做得好.
  • 不要重复自己.
  • 首先编写失败的测试,然后编写代码以便测试通过.
  • 单位之间的联系是松散的.他们对彼此不太了解.
  • 使用依赖注入.

使用的框架 我们可能会升级到Delphi XE2,主要是因为64位编译器.我看了一下Spring,但这需要D2007的更新,现在不会发生.或许明年.

问题 大多数代码仍然没有自动测试.那么提高旧代码可测试性的最佳途径是什么?或者也许最好只开始为新方法编写测试?我不确定增加自动测试的最佳方法是什么,欢迎提出意见.我们现在可以使用D2007 + DUnit,然后轻松更改为Delphi XE2 + Spring吗?

编辑:关于手动测试的当前测试方法只是"敲打它并尝试打破它" 克里斯称之为.

delphi unit-testing dunit delphi-2007 bold-delphi

19
推荐指数
1
解决办法
750
查看次数

是否有任何Delphi的框架/库接近Bold/Eco提供的功能?

不确定Bold/Eco在Borland/Codegear/Embarcadero过渡期间发生了什么,但我确实在新版本的Delphi中错过了它.有人知道一个接近的框架吗?

如果没有,也许你可以建议一个接近的库和组件的组合.

delphi domain-driven-design object-persistence bold-delphi

7
推荐指数
1
解决办法
1391
查看次数

Delphi VCL中的Bug拖放?

我使用Delphi 2007编译的应用程序在网格之间拖放,并且它在大多数情况下都能正常工作.但有时我会随机获得Access违规.我在VCL中将它调试为Controls.pas方法DragTo.

它开始是这样的:

begin
  if (ActiveDrag <> dopNone) or (Abs(DragStartPos.X - Pos.X) >= DragThreshold) or
    (Abs(DragStartPos.Y - Pos.Y) >= DragThreshold) then
  begin
    Target := DragFindTarget(Pos, TargetHandle, DragControl.DragKind, DragControl);
Run Code Online (Sandbox Code Playgroud)

异常发生在最后一行,因为DragControl为零.DragControl是TControl类型的全局变量.我尝试使用assigncheck修补此方法,如果DragControl = nil则调用CancelDrag,但这也失败,因为DragObject也是nil.

procedure CancelDrag;
begin
 if DragObject <> nil then DragDone(False);
 DragControl := nil;
end;
Run Code Online (Sandbox Code Playgroud)

为了找出为什么DragControl为零,我检查了DragInitControl.如果DragControl为零,则有两行刚刚退出.

procedure DragInitControl(Control: TControl; Immediate: Boolean; Threshold: Integer);
var
  DragObject: TDragObject;
  StartPos: TPoint;
begin
  DragControl := Control;
  try
    DragObject := nil;
    DragInternalObject := False;    
    if Control.FDragKind = dkDrag then
    begin
      Control.DoStartDrag(DragObject);
      if DragControl = nil then …
Run Code Online (Sandbox Code Playgroud)

delphi drag-and-drop delphi-2007 bold-delphi

5
推荐指数
1
解决办法
1683
查看次数

在Delphi中检测VMT或堆损坏的正确工具是什么?

我是一个使用Delphi 2007用于更大应用程序的团队的成员,我们怀疑堆损坏,因为有时会有奇怪的错误,没有其他解释.我相信编译器的Rangechecking选项仅适用于数组.我想要一个工具,当存储器地址没有被应用程序分配时,它会发出异常或日志.

问候

编辑:错误类型:

错误:模块"BoatLogisticsAMCAttracsServer.exe"中地址00404E78处的访问冲突.读取地址FFFFFFDD

EDIT2:感谢所有建议.不幸的是,我认为解决方案比这更深.我们使用补丁版本的Bold for Delphi,因为我们拥有源代码.可能在Bold框架中引入了一些错误.是的,我们有一个带有由JCL处理的callstack的日志以及跟踪消息.所以带异常的callstack可以像这样锁定:

20091210 16:02:29 (2356) [EXCEPTION] Raised EBold: Failed to derive ServerSession.mayDropSession: Boolean
OCL expression: not active and not idle and timeout and (ApplicationKernel.allinstances->first.CurrentSession <> self)
Error: Access violation at address 00404E78 in module 'BoatLogisticsAMCAttracsServer.exe'. Read of address FFFFFFDD. At Location BoldSystem.TBoldMember.CalculateDerivedMemberWithExpression (BoldSystem.pas:4016)

Inner Exception Raised EBold: Failed to derive ServerSession.mayDropSession: Boolean
OCL expression: not active and not idle and timeout and (ApplicationKernel.allinstances->first.CurrentSession <> self)
Error: Access violation at address 00404E78 in …
Run Code Online (Sandbox Code Playgroud)

delphi heap memory-corruption vmt bold-delphi

5
推荐指数
2
解决办法
2361
查看次数