ER:实体关系图

发布于 2024-12-28 15:47:14 字数 1759 浏览 2 评论 0原文

首先,我将描述我的应用程序以及您可以用它做什么,然后我将向您展示我的实体之间的技术关系,最后当然是问题。

我的应用程序工作流程:

1.) 用户可以创建一个“ReleaseVersion”对象并为其指定一个名称,例如“MyApp_v7.5.0.132”。 2.) 对于此ReleaseVersion,他将创建一个名称类似于“BookingTest”的模板,该模板由许多OrganizationUnit 对象(层次结构)组成,其中每个OrganizationUnit 可以有许多TemplateTeststep 对象。

3.) TemplateTeststep 对象由以下字段组成:

 a) PreCondition
 b) Teststep
 c) ExpectedResult

4.) 创建 Template 对象后,他将基于之前创建的 Template 创建一个 Testplan 对象。 5.)测试计划应该用户界面中显示相同的组织单位,但我需要显示仅与名为的测试计划相关的附加字段,而不是TempalteTeststep对象:

 d) Error/Exception
 e) TestStatus

所以在测试计划中有 OrganizationUnit TreeView 和带有 5 个字段 a、b、c、d、e 的 DataGrid。

5.) 当我单击“保存测试计划”按钮时,字段 a、b、c 将更新为属于模板的字段。 当我单击“保存测试计划”按钮时,字段 d 和 e 将更新为属于 XXX 的字段。

未知成分是 XXX。我已经考虑过一个名为“TestplanTeststep”的表,其中有 2 个字段。

但这应该与哪个其他表相关呢?

最重要的是,当我将 TemplateTeststepTestplanTeststep 保存到数据库并下次检索它们时,我必须非常小心,否则我可能会混淆数据。

这就是到目前为止的实体关系“描述”:

1 ReleaseVersion 有 N Testplan (这对我来说似乎是正确的,因为 Testplan 仅对某个 ReleaseVersion 有效)

N Testplan 有 M Unit >(这里有问题)

1 Unit has N TestplanTeststep(这里有问题)

1 Template has N Testplan(这对我来说似乎是正确的,因为测试计划不能属于另一个模板,创建后在其他上下文中不使用,只需打开它)

1 个模板有 N 个单元(这对我来说似乎是正确的,因为某个 UnitId 不能在另一个模板中使用,不需要它,每个模板都有自己的树/组织单元数据)

1 个单元有 N 个模板测试步骤(这对我来说似乎是正确的,因为这 3 个字段 a、b、c 属于某个 UnitId,并且在 TreeView 中仅加载与模板相关的 OrganizationUnit测试计划)

最后一个问题:

在我的实体关系中需要做什么才有意义?

愚蠢的事情是 TemplateTeststep 和 TestplanTeststep 的分离,因为它们实际上可能是一个对象或一个表。但随后我会使用字段 a、b、c 保存大量重复数据,这些字段对于每个模板都是相同的,因此对于每个测试计划也是如此。

First I will describe my application and what you can do with it, then I will show you the technical relations between my entities at the end comes the question of course.

My applications workflow:

1.) A user can create a "ReleaseVersion" object and give it a name like "MyApp_v7.5.0.132".
2.) For this ReleaseVersion he will create a Template with a name like "BookingTest" which consists of a many OrganisationUnit objects (hierarchical structure) where each OrganisationUnit can have many TemplateTeststep objects.

3.) A TemplateTeststep object consists of these fields:

 a) PreCondition
 b) Teststep
 c) ExpectedResult

4.) After he created the Template object he is creating a Testplan object basing on the former created Template.
5.) A Testplan SHOULD display in the userinterface the same OrganisationUnits but instead of the TempalteTeststep objects I need to display additional fields which are related ONLY to the Testplan named:

 d) Error/Exception
 e) TestStatus

So in the Testplan there is the OrganisationUnit TreeView and a DataGrid with the 5 fields a,b,c,d,e.

5.)
When I click the save Testplan button the fields a,b,c are updated with the fields belonging to the Template.
When I click the save Testplan button the fields d and e are updated with the fields belonging to the XXX.

The unknown component is XXX. I already thought about a table named "TestplanTeststep" with 2 fields.

But to which other table should this be related?

Above all I have to be very carefull, that a TemplateTeststep and a TestplanTeststep has the same Id when I save them to database and retrieve them the next time else I could mix up data.

Thats the entity relation "description" so far:

1 ReleaseVersion has N Testplan (that seems right to me because a Testplan is only valid for a certain ReleaseVersion)

N Testplan has M Unit (here is something wrong)

1 Unit has N TestplanTeststep (here is something wrong)

1 Template has N Testplan (that seems right to me because a Testplan can not belong to another Template, after its creation its used in no other context as just open it)

1 Template has N Unit (that seems right to me because a certain UnitId can`t be used in another template no need for it, every template has its own tree/OrganisationUnit data)

1 Unit has N TemplateTeststep (that seems right to me because these 3 fields a,b,c belong to a certain UnitId and in the TreeView are only the OrganisationUnits loaded related to the Template of a Testplan)

Final question:

What needs to be done in my entity relations that all makes sense?

The stupid thing is the separation of the TemplateTeststep and the TestplanTeststep because they could be actually ONE object or ONE table. But then I would save lots of duplicate data with the fields a,b,c which are the same for every template thus for every Testplan too.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千年*琉璃梦 2025-01-04 15:47:15

我在这里看到的主要问题是:如果每个模板都有 TemplateTeststeps,但每个模板也可以作为测试计划的一部分,我们如何跟踪结果?看起来您正在考虑让每个测试计划保存这些测试步骤的副本,以及额外的结果字段,但这不是正确的方法。

我处理此问题的方法是使用多对多表(TestPlan 和 TemplateTeststep 的外键),该表还保存这些额外的结果字段(Error 和 TestStatus)。因此,您不会复制有关测试步骤(字段 ac)的信息,但您确实有机会将每个步骤放入许多测试计划中并记录其结果。

The main question I see here is: If each template has TemplateTeststeps, but each of those can also feature as a part of a TestPlan, how do we track the results? It looks like you're considering letting each TestPlan hold a copy of those TestSteps, with extra result fields, but that's not the way to go.

The way I'd handle this is with a many-to-many table (foreign keys to TestPlan and to TemplateTeststep) that also holds these extra result fields (Error and TestStatus). So you're not duplicating the info about the test step (fields a-c), but you do get an opportunity to put each of those steps into many TestPlans and record their results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文