书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
The design and implementation of Banks' trading system
Abstract
With the development of information technology in our country, whether between domestic Banks and foreign Banks, competition is increasingly fierce, how to efficient, convenient and fast to complete the user's requirements is a bank the priority of survival. Top priority is the bank account of bank management and transaction management, this system is designed for daily bank transactions.
This system is designed by adopting the idea of software engineering, according to the demand analysis, general design, detailed design, program coding, testing process to develop a bank trading system. For the background database, this system USES the SQL SERVER 2005 that is associated with the front desk interface. The whole system with Java as a development language on Myeclipse8.5 platform for design and development.
The whole system is mainly used to help Banks deal with day-to-day business, divided into administrators and ordinary users module. Administrator has administrative privileges on the system, users can manage information and transaction information, such as ordinary users can transfer and cash business, convenient bank daily business operations.
Key words: Myeclipse;Database;Java;Banks' trading system
本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计
<%//对数据库进行账户记录
String sql="";
sql="select * from zhuanzhangjilu where 1=1";
sql=sql+" and (zhuanchuzhanghao
like '%"+request.getSession().getAttribute("username")+"%' or
zhuanruzhanghao like '%"+request.getSession().getAttribute("username")+"%' )";
sql=sql+" order by id desc";
ResultSet RS_result=connDbBean.executeQuery(sql);
String id="";
String zhuanchuzhanghao="";String zhuanruzhanghao="";
String zhuanzhangjine="";
String beizhu="";
String addtime=""; String leixing="";
int i=0;
while(RS_result.next()){
i=i+1;
id=RS_result.getString("id");
zhuanchuzhanghao=RS_result.getString("zhuanchuzhanghao");
zhuanruzhanghao=RS_result.getString("zhuanruzhanghao");
zhuanzhangjine=RS_result.getString("zhuanzhangjine");
beizhu=RS_result.getString("beizhu");
addtime=RS_result.getString("addtime"); leixing=RS_result.getString("leixing");
%>
<%=i %>
<%=zhuanchuzhanghao %>
<%=zhuanruzhanghao %>
<%=zhuanzhangjine %>
<%=beizhu %>
<%=leixing %>
<%=addtime %>
<%
}
%>
本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
以上数据共<%=i %>条, 打印本页
6 系统测试
6.1 软件测试基本理论
6.1.1 软件测试
任何软件在发布之前都要经过测试,以保证软件是否完成了用户需求,是否达到了本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
相关的质量标准。人们在软件开发过程中,日渐认识到软件测试的重要性,良好的测试过程不仅方便开发人员发现程序问题的出处,更重要的是保证在软件发布后的质量,也进一步有利于对软件的后期维护。这一过程也渐已形成行业,软件测试工程师在市场上很是火爆,需求也很大。可见,软件测试对软件行业的重要性。同时,我们应该对软件测试有一个正确的认识。软件测试是为了发现程序中的错误而进行的过程,并不是说测试过程中没有发现错误就是好的,而是发现出问题才更有效的达到了测试的目的,以防止产品在投入使用之后才发现漏洞,造成经济损失与精力浪费。其次,测试方案对测试阶段工作的完成起着重要作用。好的测试方案被定义为极可能发现没有发现的漏洞的方案。有经验的编程人员和测试人员会总结出一些好的测试方案,这些有利于缩短工作时间,提高了测试效率。再次,没有发现漏洞的测试其实也是很有价值的,他们是完整的测试,是评定软件产品质量的一种方法,值得人们借鉴和采用。
6.1.2 软件测试工程师
软件测试工程师不仅仅只是指能够测试出软件的错误,理解产品的需求,并且更专业的来说,应该是能够写出相应的测试规范和测试用例的专业人员。他们相当于软件企业中的质量管理人员,及时对软件产品进行监督与检查,发现错误,提示程序员及时对软件进行修改,最终保证产品的正常运行。
软件测试工程师可以按期级别和职位的区分而分为初级软件测试工程师、中级软件测试工程师、高级软件测试工程师。初级软件工程师一般做些基础性的工作,例如按照一定的测试方案和流程对软件产品进行测试,这类测试大多是以用户的身份进行功能性测试,以此最直观、最快捷的方式检查软件产品中是否存在缺陷与不足,找出漏洞与需要改进的地方。对于稍高层次的中级软件测试工程师,他们已经从初级阶段走了,有了一些在测试方面的实际工作经验,对软件产品中哪些模块可能会出现什么缺陷也有了一定的了解。因此,他们主要的任务是根据自己的经验编写完善的软件测试方案和相关的测试文档,并且与项目组成员一起商定完美的软件测试阶段的工作计划安排,合理把握软件测试相关任务,能够使用合适的测试工具完成测试任务。更高层次上,是高级软件测试工程师的任务。他们不仅需要熟练掌握各类软件测试和软件开发技术,并且更应从宏观层次上把握软件测试行业的发展趋势与动态,以便能够对以后可能出现的问题进行正确的评估和分析。看似简单的软件测试工作,其实需要软件测试人员的创新能力与综合分析能力,工作中保持高度的耐心和责任心,执着认真、追求完美,并且还应具备大量的编程经验与发现问题的能力。
6.1.3 软件测试基本原则
软件测试需要遵循一些基本的原则,以便更好的完成测试工作。测试最好应该在需求阶段就开始进行,因为如果最后才发现产品其实并不能够满足用户的需求,这将会是最大最严重的错误。一个正规的软件企业不会将软件测试的任务全权委托给程序员自己进行,因为程序员本事身难发现自己所编程序的错误,软件测试的工作应该由正规的软件测试部门来进行,保证产品的质量。对于测试时用例的选取既要考虑到合法的输入,又要保证有不合法的输入和边界条件。若软件测试人员发现到了软件的错误,应该由其编程人员进行确认。若是遇到严重的错误,编程人员都无法确认的,则需要评审会集体本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
进行分析和讨论,进行严格的确认,保证这个错误的严重程度是否真的影响产品。一个严格的软件测试计划,会使繁琐的测试工作事半功倍,该计划需要有一定的指导性。对于测试时间的安排应该合理,按要求按步骤有条不紊的进行,以求达到一个尽量完美的测试。应该严格执行测试计划,排除测试的随意性。测试计划包括:所测软件的功能,输入和输出,测试内容,各项测试的进度安排,资源要求,测试资料,测试工具和测试用例的选择等等,还应包括测试的控制方式和过程,测试的评价标准等。对于测试计划,要明确规定,不要随意解释。同时,还需要注意的是,测试过程中的测试计划、测试用例、错误统计、分析报告等文档,应该妥善的保存起来,为今后的软件维护提供依据和方便。并且,这些测试计划和用例的文档很有用,如果发现某一程序模块似乎比其他程序模块有更多的错误倾向时,则应当花费较多的时间和代价去测试该程序模块,节省了测试精力。
6.1.4 软件测试分类
测试方式有很多种。按其是否注重软件具体实现的功能和软件内部结构划分可以分为白盒测试、黑盒测试和灰盒测试。按其测试过程是否需要执行程序的角度可以分为静态测试和动态测试。若从软件开发的过程按阶段划分则有单元测试、集成测试、确认测试、系统测试和验收测试。
6.2 软件测试过程
经过大量前人的总结,现在我们已经基本形成了一套基本的软件测试过程。基本分为四个阶段:单元测试、集成测试、系统测试和最后的验收测试。
6.2.1 单元测试
单元测试中又可以根据自身情况去采用静态测试或者动态测试,或者索性两者结合起来一起使用。静态测试相对常见,也就是通过人工结合文档检查代码,审查代码的逻辑、风格、规则是否符合相关规范。如果面对复杂的问题,静态测试往往工作效率低,浪费时间,且查找的错误相对少,很容易忽略软件中潜在的错误。为了解决这一问题,我们还可以采用动态测试。动态测试一般是测试人员通过测试工具进行测试,或者通过运行程序直观的得出结论。这样,不仅提高了工作效率,重要的是更容易发现错误,是测试工作系统化、完整化、规范化。
6.2.2 集成测试
集成测试,顾名思义是将各个模块集合起来进行的测试。主要检查模块间接口是否满足相关的规范,且尽量达到高内聚低耦合的要求。这一过程需要参考规格说明书中的需求进行测试,看软件体系是否满足要求。单元测试可以由开发人员进行,集成测试一般由专门的软件测试人员或部门进行。因为这个阶段需要有准备计划的进行,因此测试人员的主要任务还应包含对测试工作的设计、执行和总结。在测试过程中需要有缺陷记录,发现缺陷,修改缺陷,然后进行回归测试,为下一步的系统测试打牢基础。 本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
6.2.3 系统测试
系统测试则是在上述两步完成之后将软件置于模拟的现实情况下进行测试,把已经经过确认的软件纳入实际运行环境中,与其他系统成分组合在一起。这一阶段主要检查系统是否和软硬件、网络、用户计算机配置、操作系统等相连接,能否在用户的要求上运行。
6.2.4 验收测试
验收测试则是在专门的测试人员测试完系统,保证可以交付给用户时,由用户验收时所做的测试。他们真正的对系统进行操作,测试人员配合检查,做出错误分析,改进系统,并生成总结报告。最后,由用户验收成功。
6.3 本系统测试实例
在该银行交易系统中,包含管理员和普通账户模块,具体又有账户添加、账户查看、转账、取现、备份、交易记录等子系统,用于银行交易日常运作的整个过程,各个子系统相互关联,因此可以采用安装先单元测试,再集成测试,然后系统测试,最后整体验收测试的步骤进行。且这样进行,降低了测试难度,节省了测试时间。下面列举了该系统测试时的部分实例:
1.对于登录模块,我们需要验证用户身份。当用户名是“admin”,密码是“admin”时可以进入管理员模块。若其中之一发生错误,系统即可提示“你输入的用户不存在或密码错误,或帐户处于挂失状态,请重新登录!”。管理员可以添加普通用户,例如有普通账户名称为“2010004579”,密码为“2010004579”,则当输入时便会进入普通账户模块,这个模块中只有交易模块和更改自己信息模块。
2.对于密码用户的密码修改模块,当用户输入密码,但未在“确认密码”再次输入密码时,若点击“确认”,系统会提示“请输入确认密码”;若“新密码”与“确认密码”输入不一致时,若点击“确认”,系统也会有提示“两次输入密码不一致”。
3.对于挂失模块,若管理员点击“挂失”时,可看到普通账号的状态由“正常”改为“挂失”,并且该账号进入系统时,系统会提示“你输入的用户不存在或密码错误,或帐户处于挂失状态,请重新登录!”。若将挂失的账号解冻,普通账户的状态会由“挂失”改为“正常”,并且可以进入系统。
4.对于用户交易模块,若从取现模块中交易了100,则在交易记录中便会显示取现100的信息;若从转账模块中交易了100,则在交易记录中便会显示转账100的信息,并且会显示出转入账号和转出账号。
5.对于用户交易模块中,若取现金额或转账金额大于本身账号的余额,系统便会认为这是错误操作,会提示“对不起,余额不足,操作失败~~”。
6.对于超级管理员模块中,若超级管理员将普通管理员的信息删除,便会将该普通管理员对系统的权限收回。当该普通管理员想进入系统时,系统会提示“你输入的用户不存在或密码错误,或帐户处于挂失状态,请重新登录!”。
本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
6.4 系统整体测试
在进行完单元测试和集成测试之后,为了保证系统正确无误的运行,还要进一步进行多次整体测试。从用户登录到中间的各项功能模块的测试,直至最后退出系统,保证不会出现功能错误和性能错误。这一阶段需要参考用户需求分析进行仔细对照,检查是否确实完成了用户需求,验证软件产品是否与系统需求用例不相符合或与之矛盾,确保软件系统测试活动及其结果及时通知相关小组和个人,保证将系统完美的交付给用户使用。当然,这之后还应不定期的根据需要对系统进行跟踪维护,保证系统的寿命。 6.5 不足与改进
由于时间比较紧张,所学知识有限,在系统设计过程中难免出现不足。比如系统界面设计的虽然简单明了,但是不够美观,只用了myeclipse做背景处理,如果时间充足用photoshop会更好些;又比如在信息录入时,数据规范比较宽松,在真正的银行交易系统中,这些需要进一步加强。
结论
本文主要通过对银行交易系统的背景掌握和调查分析,逐步了解了该系统在银行业务处理过程中的作用以及流程,并切身感受到银行交易系统对银行业务的重大影响。一个全面高效且具有人性化的银行交易系统往往影响着银行的办事效率,从而影响整个金融界的发展。
本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
在开发此银行交易系统过程中,我将大学的一些基础课程的理论与实习时所获得的实践能力相结合,使得自己不仅巩固了基础知识,更是提高了自己的编程技巧。尤其在JSP编程方面,从单独的网页制作到模块关联,再到最后系统整合,将以前所学真正的融会贯通,开发能力有所提高。除了JSP,一个重要的应用就是在数据库方面,扎实了SQL语句基础,领悟了数据库使用的实质,特别对数据库的存储过程有了深一步的认识与应用,这些是课本上吸取不来的。同时,该系统模块完成过程中还涉及到软件工程导论中软件测试的一些方法,将理论用于实践,是提高自己的绝对途径。
由于这次是系统的完成一个项目的开发,发现了很多以前未重视的问题,并且在开发过程中有了些项目经验。比如,在设定系统课题后,不应急于进入编程阶段,对系统进行需求分析、总体设计、模块设计、界面和数据库如何设计业同样重要。这些都是为之后的编程奠定基础,前面的一系列活动编写成文档,才能在编程过程中目标明确,节约开发时间,提高开发效率。重要的是在软件测试阶段,先前的软件需求分析更是尤为关键。
该系统基本实现了银行交易系统需要的功能,比如管理员模块、普通账户模块、交易记录模块、转账和取现模块等。在以前知识的基础上,使得这次系统有了很好的可扩展性,便于后期的维护和升级。但是也存在一些问题,毕竟时间精力和知识有限,页面不够人性化,过于单调,数据完整性和安全性有所欠缺,都是值得改进的地方。
随着经济的发展,人们生活水平的提高,银行将会随处可见,影响我们生活的方方面面。比如可以将网络应用于银行,实现现金直接通过无形的交易方便我们出行娱乐等。这些功能都值得我们去进一步加强。
参考文献
[1]张永常.Java程序设计实用教程[M].北京:电子工业出版社,2006.8 [2]柳西玲.许斌编著.Java语言应用开发基础.北京:清华大学出版社,2006 [3][美]Cay S. Horstmann、Gary Cornell. Java核心技术卷I:基础知识(第8版)(英文影印版).人民邮电出版社,2008.11
本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
[4]陈国君等编著.Java2程序设计基础.北京:清华大学出版社,2006
[5][美]Bruce Eckel. Thinking In Java.英文第4版.北京:机械工业出版社,2007
[6]朱喜福等编.Java程序设计.北京: 人民邮电出版社,2005
[7]袁然、郑自国、邹丰义著.java案例开发集锦.电子工业出版社,2005.9
[8]严明Oracle教程.苏州:苏州大学出版社,2010.11
[9]林信良. JSP & Servlet学习笔记[M].清华大学出版社, 2012.5
[10]孙卫琴. Tomcat与Java web 开发技术详解[M].第2版.电子工业出版社, 2009.1 [11][美]Herbert Schidt著.Java参考大全.鄢爱兰.鹿江春译.北京:清华大学出版社,2006 [12]宛延闿等编著.实用Java程序设计教程.北京:机械工业出版社,2006
[13]Chen,Li; Foster, Steven; Le, Hoai.Concepts Vs. programming skills in java learning. ASEE Annual Conference Proceedings, p 805-814, 2003
[14]Anonymous.QNAP announces beta version of multimedia player solution for Android
platforms.Worldwide Computer Products News,2010
[15]Shawn Every.Pro Android Media[M].State of California: APRESS,2009
致谢
这次毕业设计的完成,标志着我大学四年的美好并且难忘时光也已接近尾声。
本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
首先感谢母校给了我一个很好的学习机会,三年的在校经历,每天老师们的谆谆教诲,认真授课为我的理论知识奠定了良好的基础,将会使我在以后的工作生活中受益匪浅。
再次更应感谢上海杰普提供的大四学习机会,这次毕业设计的完成仅有学校的理论知识是远远不够的,重要的是大四这年在杰普学到的实践能力,提高了我们的编程技巧,增加了我们对编程的兴趣。比如李娜老师,任青松老师都对我们耐心讲课,手把手教会我们如何搭建环境,如何高效编写代码等。
最后特别感谢冯秀芳老师、任青松老师、罗成果老师对我设计过程中的指导,为帮助我顺利完成毕业设计投入了自己的时间和精力。
外文文献
An Environment for Self-Assessing Java Programming Skills
本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
in Undergraduate
First Programming Courses
Abstract
In this paper we propose a new environment for allowing students of a first programming undergraduate course to test their Java code. This environment allows the student to learn the basics of the Java language without necessarily knowing the object-oriented features of the language itself,and the teacher to propose new tests by making use of a graphical test editor. Moreover, the client-server architecture of the web-based version of the environment is designed so that the student does not even need a Java virtual machine on its computing device, but only a web browser. This latter feature makes our environment a useful tool for ubiquitous testing of Java programming skills.
1. Introduction
A continuously growing number of undergraduate first programming courses use Java as the first programming language,recognizing this language’s role in the development of
web-based systems and the emerging prominence of the object-oriented approach to software development (see, for example, [4]). There is no doubt that the principal features of object-oriented programming are of great benefit when it comes to constructing large software systems, but it is a long journey from the first programming course to the construction of such systems. For this reason, several educators argued that it is better to introduce students to structured programming before turning to object-oriented programming and to other approaches that are beneficial for programming in the large (see, for example, [2]). Motivated by the apparently contrasting desire of using Java as the first programming language and of following the ―structured programming before object-oriented
programming‖ approach, a simple application, called JavaMM (or, equivalently, Java--), has been developed at the Department of Computer Science of the University of Florence.This application allows the students to familiarize themselves with the basic structures of the Java 本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
programming language and with the basic notions of structured programming, without having to bother with issues related to object-oriented programming from the very beginning of the course. A detailed description of Java-- (along with a survey of existing tools for teaching Java) can be found in [1]: The application itself is freely available starting from the Java-- home page (see [9]). Java-- has been successfully used since 2002 within the first programming course of the degree program in Computer Science: In particular, the tool has been used during the first month of the course,while successively the students have been introduced to a more sophisticated IDE (such as JCreator LE [10]). According to the survey compiled at the end of the course, the students seemed to appreciate the tool: Only one student over almost one hundred complained about Java--, without specifying the reasons of the complaint. Moreover, the number of students that passed the exam at the end of the first edition of the course, in which Java-- was used, increased by more than 40% with respect to the previous edition. In this paper, we propose an extension of Java-- that includes a self-test exercise component, which allows students to test their knowledge of the Java language by writing and checking the correctness of a method performing a specific required task. This file contains the specification of the method to be tested, the specification of a correct implementation of the method, and the specification of how the test input has to be chosen. The checker interprets the XML file in order to compare the result of the submitted method with the correct method on the specified input. Subsequently, it generates either an error message specifying the input that caused the error or a message stating that the test has been passed.From the teacher point of view, we have developed a graphical tool that allows the user to easily generate new tests, that is, to create the XML file associated with a test (of course, the teacher has to write and compile the Java code containing the correct implementation of the method to be tested).Most of the textbooks on Java programming make use of several different kinds of self-test exercises.
Moreover, several authoring programs enables teachers to make (Web-based) interactive teaching materials based on these exercise-types: An example of such programs, available both for Windows-based and for MacOS-based computers, is the set of Hot Potatoes 本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
applications (see [8]).However, as far as the authors know, no tool is available to generate Java code-writing exercises that allows the students to verify that their solutions is semantically (not only syntactically) correct. In [7] a test-first approach to programming and to learning is described: To this aim the author first uses an ad hoc framework, and then uses JUnit. His extreme teaching approach, however, is based on the assumption that objects really need to come first, while, as we said before, our approach assumes that structured programming comes before object-oriented programming. For this reason, we decided to integrate the Java-- with the self-test exercise component (of course, our tool can be also used within a Java course where objects are taught first).In the paper, we also propose a web-based client-server version of Java-- (including the self-test exercise component) that allows the students to make use of this tool by means of basically any web browser, without even needing a Java virtual machine. In particular, the proposed environment consists of two main ingredients. From the client point of view, there are static HTML pages, which allows the user to write Java code, to submit the code to a Java compiler, to see either the compilation errors or the standard output messages, and to test the implementation of a specified method. From the server point of view, there is a collection of servlets (for an introduction to servlets, see [3]), which receive and compile Java codes, and generate either error or standard output HTML pages. The main advantage of this approach is the fact that the client software requirements are extremely light, and basically any currently available mobile computing device can be used in order to utilize the Java-- tool (of course, standard computers can also be used. . . ). In other words, this environment turns out to be a useful tool for ubiquitous programming and learning Java.The paper is structured as follows. In Section 2, we describe the structure of the XML file that specifies a test, and we briefly describe the graphical tool that allows to generate this XML file. In Section 3, instead, we describe the component of Java-- that allows the student to execute one test, while in Section 4 we introduce the software architecture of the web-based client-server version of Java--. Finally, in Section 5 we present some preliminary evaluation results regarding the effectiveness of the Java-- tool, while in Section 6 we propose some directions for future research and developments.
本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
2. The test specification
Each test in our framework consists of checking the correctness of a method implementation. Thus, a test is described by specifying the signature of the method, that is, the name of the method, the type of its returned value, and the list of the types of its parameters. Since our target is to deploy a self-test tool for undergraduate students of a first programming course based on the ―structured programming before object-oriented
programming‖ approach, in the first version of our program we have decided to allow only a
subset of primitive data types, the String class type, and arrays of these types. In particular, the returned values and the input parameter can be int, double, char, boolean, String, or an array of any of the previous types. The document type definition (DTD) associated with the XML file containing a method specification is the following one:
Note that, besides the signature of a method, the above DTD file contains some more elements. In particular, a test description has to specify the name of the class that contains the correct implementation of the method, which has been coded and compiled by the teacher. Moreover, the test can be performed on fixed values of the parameters, on random values of the parameters, or on a combination of fixed and random values: In the case of randomly chosen input values, the test description has to specify the range within which the random values have to be chosen. Finally, in the case of randomly chosen values, the test can specify how many times it has to be performed.As an example, let us suppose that we want to test the 本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
implementation of a method maxBetweenTwo, which is supposed to return the maximum between two input integer numbers: ?10 and 10. Moreover, suppose that the correct implementation of this method is contained in the class Maximum. Then, the XML file specifying such a test is the following one:
1MaximumINT?10INT10
The XML files containing the specification of a test can be manually created by the teacher: However, a simple graphical interface has been developed in order to support this task. Once the test has been specified, the teacher has to write and compile the class containing the correct implementation of the method. In our example, this class might be the following one:
本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
public class Maximum {
public int maxBetweenTwo( int a, int b ) {
return a>b?a:b;
}
}
Finally, the teacher can associate with the test a natural language description of the test itself (to be included in the file description.txt) and a code template of the method that the student has to code (to be included in the file template.txt). In the example of the maximum between two integers, the description might be ―Write a method, called maxBetweenTwo,
that, given two integers, returns the maximum between them‖, while the code template might
be the following one:
int maxBetweenTwo( int a, int b ) {}
3. The test execution
Figure 1 shows the interface through which the student can execute a test (all the other functionalities of the JavaMM program are described in [1]). As shown in the first picture, the student can choose one test among all those that have been specified by the teacher (in our case, there are three tests available). Once the student has chosen a test, the corresponding code template and description text are shown in the code and in the test description panel, respectively (as shown in the second and in the third figure).At that point, the student has to write the code that implements the method: This code can finally be tested by clicking on the Test button. If the implementation is correct (or at least passes the test), a confirmation message is shown in the Output panel, otherwise a failure message is shown in this panel (we are assuming that the code written by the student is syntactically correct, since otherwise a compilation error would appear in the Errors panel). The failure message also specifies the name of the method, the value of the input parameter that caused the failure, the expected result, and the obtained result (see, for example, the last picture of Figure 1 where the test failure is due to the fact that the body of the method maxBetweenTwo contained the instruction return a
注意,除了方法的签名,上面的DTD文件包含更多的元素。特别是,一个测试描述指定类的名称,包含正确的实施方法,编码和编制的老师。此外,测试可以执行固定值的参数,参数的随机值,或固定和随机值的组合:在随机选择的输入值的情况下,测试描述指定的范围内随机值必须选择。最后,在随机选择的值的情况下,测试可以指定要执行多少次。作为一个例子,让我们假设我们想要测试的实现方法maxBetweenTwo,它应该返回两个输入之间的最大整数数字:?10和10。此外,假设的正确实现该方法包含在类最大。然后,XML文件指定这样的测试是下列之一:
1MaximumINT?10INT10
XML文件包含测试的规范可以手动创建老师:但是,一个简单的图形界面开发为了支持这项任务。一旦测试已指定,老师必须编写和编译的类包含正确的实现方法。在我们的例子中,这个类可能是下列之一:
public class Maximum {
public int maxBetweenTwo( int a, int b ) {
return a>b?a:b;
}
本参考设计材料,包含项目源代码,屏幕录像指导、项目运行截图、项目设计说明书、任务书、报告书以及文献参考翻译等,完
整的设计文件及源代码,资料请联系68661508索要
更多相关参考论文设计文档资源请访问
}
最后,老师可以与测试测试本身的自然语言描述(包含在文件description.txt)和一个代码模板的方法,学生必须代码(包含在文件template.txt)。在两个整数之间的最大的例子中,描述可能“编写一个方法,称为maxBetweenTwo,给定两个整数,返回它们之间的最大”,而代码模板可能是下列之一:
int maxBetweenTwo( int a, int b ) {}
3.测试执行
图1显示了界面,学生可以通过执行测试(JavaMM项目的所有其他功能[1]中描述)。第一张图片所示,学生可以选择一个测试在所有那些被老师指定的(在我们的例子中,有三个测试可用)。学生选择一个测试后,对应的代码模板和描述文本中所示的代码和测试描述面板,分别(第二和第三图所示)。在这一点上,学生必须写代码实现方法:这段代码最终可以通过单击Test按钮进行测试。如果实现是正确的(或至少通过测试),确认消息输出所示面板,否则失败消息显示在这个面板(我们假定代码写的学生在语法上是正确的,因为否则编译错误出现在错误面板)。失败消息还指定方法的名称,输入参数的值导
预期的结果,获得的结果(见,例如,最后画的图1测试失败是由于身体的方法致失败,
maxBetweenTwo指令返回一个包含