Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2020.1

...

Table of Contents
maxLevel1

关于任务分配和作者

通常有许多不同的团队成员在整个 SDLC 中从事开发项目 — 从应用程序逻辑的开发人员,到 Web 接口的开发人员,再到验证端到端流程和事务的 QA 测试人员。

...

  • 允许每个团队成员只将他或她分配的任务从命令行测试导入 UI。
  • 给每个团队成员一份只包含他或她分配任务的报告。
  • 在经理报告中指出哪个团队成员负责哪些任务。

开发人员的任务分配

对于开发人员,代码作者数据可以影响测试了多少代码,以及每个开发人员的质量任务视图中显示了哪些测试结果。

通过更改测试配置的范围设置,您可以将测试配置为只覆盖您创建的文件或行,或者只覆盖您在指定日期之后修改的文件或行。此外,如果为用于测试的测试配置设置了 Test only files/lines authored by [your_username] 范围选项所编写的测试文件/行,那么质量任务视图将只显示您所编写的代码中的测试任务,以及重新分配给您的任何其他任务。 

QA 人员的任务分配

对于 QA 人员来说,Parasoft 测试可以通过多种方式基于源代码控制数据分配任务:

...

Tip

如果您在 Parasoft 测试环境中将源文件添加到项目中,您可以看到分配到该源文件的特定行中的团队成员,以及关于上次修改它的时间的信息:

  1. 打开相应文件的编辑器。
  2. 右键单击要查看其作者的行,然后从快捷菜单选择  Parasoft> Show Author at Line

注意,如果不使用源代码控制数据计算任务所有权,则消息将显示文件的修改信息(而不是所选的特定行)。

了解 Parasoft 测试的作者和任务分配

Parasoft 测试可以根据源代码控制数据(来自受支持的源代码控制系统)、@author Javadoc 标签、xml 映射文件(直接文件到作者的映射)和/或当前本地用户分配错误所有权。

...

Tip

若要查看指定给某一行源代码的作者,以及关于最后一次修改时间的信息,请执行以下操作:

  1. 打开相应文件的编辑器。
  2. 右键单击要查看其作者的行,然后从快捷菜单选择  Parasoft> Show Author at Line .

注意,如果不使用源代码控制数据计算作者身份,则消息将显示文件的修改信息(而不是所选的特定行)。

更改计算作者身份的方式

可以指定作者身份计算设置:

  • 通过 Parasoft 测试 GUI 中的范围和作者首选项页面。
  • 通过 localsettings。

...

  1. 选择 Parasoft> Preferences 以打开首选项对话框。
  2. 在左窗格,选择 Parasoft> Scope and Authorship 类别。
  3. 使用可用控件指示您希望 Parasoft 测试如何计算范围和作者。
    • Use source control (modification author) to computer scope: 源码控制数据将用于计算作者身份。
    • Use file system (xml map) to compute scope: 您将直接指定如何为特定文件或文件集分配任务(例如,您希望开发人员1 负责一组文件,开发人员2 负责另一组文件,等等)。关于更多详情,请查阅 Specifying File-to-Author Mappings 。
    • Use file system (@author tag) to compute scope: @author Javadoc 标记将用于计算作者身份。这只适用于 Jtest。
    • Use file system (current user) to compute scope: 本地用户名将用于计算作者身份。
  4. 单击 OK 设置并保存设置。

有关如何通过 localsettings 设置作者身份设置的更多详情,请查阅 配置 Configuring Localsettings

Anchor
Specifying File-to-Author_Mappings  
Specifying File-to-Author_Mappings  
指定 File-to-Author 映射

如果希望直接指定哪些作者负责哪些文件(而不是自动计算作者数量),可以指定文件到作者的映射。这些映射可以自动配置一次,然后按照 Configuring Preferences Overview中所描述的那样使用自动配置过程在整个团队中共享。

...

  • From the GUI - 在 Preferences 对话框中指定该文件的路径的 Scope and Authorship> Authorship Mapping 类别(使用 Shared File 选项)。
  • From the command line - 使用以下命令指定该文件的路径: scope.xmlmap=true, scope.xmlmap.file=[file], 和 scope.mappings.locationproperties (通过 -local-settings 选项,如 配置 Configuring Localsettings中所述。这将覆盖 GUI 中指定的任何作者设置。

下面是一个示例 XML 作者身份映射文件:

Code Block
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE authorship (View Source for full doctype...)>
<authorship>
  <!-- assigns all files named: "foo/src/SomeClass.java" to "author1" -->
  <file author="author1" path="foo/src/SomeClass.java" />

  <!-- assigns all files whose names starts with any character (except /) and ends with "oo/
src/SomeClass.cs" to "author2" -->
  <file author="author2" path="?oo/src/SomeClass.cs" />
  <!-- assigns all *.c files in any directory to "author3" -->
  <file author="author3" path="**.c" />
  <!-- assigns every file whose path has a folder named "src" to "author4" -->
  <file author="author4" path="**/src/**" />
  <!-- assigns all files located in directory "src" to "author5" -->
  <file author="author5" path="src/**" />
  <!-- assigns all files in directory "src" whose name starts with "Test" i.e. "src/some/
other/dir/TestFile.java" to "author6" -->
  <file author="author6" path="src/**/Test*" />
</authorship>

从源代码控制生成 XML 映射文件

脚本可用于从源代码控制系统生成 XML 映射文件下面的示例 Perl 脚本演示了如何从 CVS 生成作者身份映射文件。如果使用不同的源代码控制系统,请进行适当的修改。

Code Block
#!perl

############################################################
# GetAuthors.pl
# Sample script to generate file --> author mapping.
# Note that this is usually run only once, when you first
# deploy Parasoft Test .
#
# This script assumes that you have a list of all the files in the
# project. For example, such a list can be obtained on windows
# by using "dir /s/b *.c" for c files.
############################################################

sub GetAuthor
############################################################
# Gets the author (person who last modified the file) for
# the input file.
############################################################
{
   my $fileName = shift(@_);
   my $author = "DontKnow";
   system qq(cvs log $fileName > cvslog.txt);
   open(TMPFILE, "< cvslog.txt") || die "Could not open cvslog.txt";
   while (<TMPFILE>)
   {
         chop;
          if (m/(^date.*author:)(.*)(;[\s]*state)(.*)/)
          {
              $author = $2;
          }
   }
   close TMPFILE;
   return $author;
}

print "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
print "<mapping>\n";

############################################################
# AllCFiles.txt has a list of all the c files in the
# project. The following loop iterates through all the
# files and assigns owners to each.
############################################################
open(FILELIST, "<AllCFiles.txt") || die "Could not open AllCSFiles.txt";
while (<FILELIST>)
{
    chop;
    my $fileName = $_;
    my $author = GetAuthor($fileName);
    print "<file path=\"$fileName\" ";
    print "author=\"$author\" />\n";
}

print "</mapping>\n";

Anchor
Configuring Task Assignment and Code Authorship_Settings
Configuring Task Assignment and Code Authorship_Settings
指定作者到作者和作者到电子邮件的映射

默认情况下,Parasoft 测试假定它检测到的每个用户名值(例如,基于源代码控制数据、系统的本地用户设置、@author 标记、直接映射文件、导入的 scanner.properties 文件)是代码作者的用户名,相关开发人员的电子邮件是 [username]@[mail_domain]。

...

Info
iconfalse
title在 localsettings 中指定作者映射

您还可以在 localsettings 文件中指定作者映射(从命令行或存储在 Concerto 上的 Parasoft 测试首选项中)。

为此:

  1. 设置 authors.mappings.location=local
  2. 使用 authors.mapping 指定合适的映射。
  3. 使用 authors.user 指定邮箱设置。

例如:

authors.mappings.location=local

authors.mapping1=baduser,gooduser

authors.mapping2=brokenuser,fixeduser

authors.mapping3=olduser,newuser

authors.user1=gooduser,[email protected],Gooduser Stowe

authors.user2=fixeduser,[email protected],Fixeduser White

...

确定“区分大小写”模式

可以确定是否将 author 值视为区分大小写的值。“区分大小写”设置适用于以下情况中的作者值:

...

这里的“区分大小写”设置应该与 Concerto 中的“区分大小写”设置匹配。默认情况下,Concerto 区分大小写。关于如何在 Concerto 中配置“区分大小写”的更多详情,请查阅 Concerto 用户指南。

“区分大小写”详情

“区分大小写”设置决定同一用户名的多个变体是被视为一个用户还是多个用户,例如:

...

当团队使用的外部数据库中用户名的情况并不重要时,“区分大小写”模式尤其有用。如果用户名 david 作为 DAVID 存储在数据库中,并且您使用的是“区分大小写”模式,那么为 DAVID 导入的任务将无法与 david匹配。

“区分大小写”配置

您可以在首选项面板中设置“区分大小写”设置(Parasoft> Authors> Ignore case of user names in Parasoft Test platform)。

...

还可以使用 localsettings 选项 authors.ignore.case=true|false配置此模式。有关 localsettings 选项的更多详情,请查阅 配置 Configuring Localsettings

使用多个源代码控制系统时处理作者身份

如果您和/或您的团队成员使用多个源代码控制系统,但对所有源代码控制系统使用相同的登录名,请按照以下步骤启动产品,以确保从源代码控制计算出准确的作者身份:

  • 独立版 Jtest: jtest -J-Duser.name=your_username ...
  • 独立版 SOAtest:SOAtest -J-Duser.name=your_username ...
  • 独立版 C++test: cpptest -J-Duser.name=your_username ...
  • 插件: eclipse ....-vmargs -Duser.name=your_username

手动设置本地用户

如果使用“本地用户”数据来确定作者,Parasoft 将默认使用机器上定义的本地用户设置。

...