使用TextTest来做认定测试——本质是通过diff对比程序的运行log输出,来看测试结果和预期结果是否相同

本文涉及的产品
日志服务 SLS,月写入数据量 50GB 1个月
简介:
Welcome to TextTest.org!
TextTest is an open source tool for text-based functional testing. This means running a program in lots of different ways from the command line, and using the text output produced as a means of controlling the behaviour of that application.
Also on this site are StoryText and CaptureMock, which aid in GUI testing and mocking respectively. They do not depend on TextTest in any way but are well suited to being used together with it.
Site index
Introducing TextTest and Acceptance Testing
TextTest Tutorials and Reference
Formerly "PyUseCase". Domain-language GUI testing for PyGTK, Tkinter, wxPython, Swing and SWT/Eclipse RCP
Capture-replay mocking for Python, command-line programs, and synchronous messaging
Conference publications, presentations and workshop summaries
Download a TextTest release or the latest source
Live test results and coverage for the self-tests

 

About Texttest
Background
We feel that the world still produces way too much software that is frankly substandard. The reasons for this are pretty simple: software producers do not pay enough attention to testing, or rely too heavily on manual testing. Manual testing should be focussed on examining the user experience and finding complex bugs, and too often it is used for simple regression testing : to check that the latest release does not crash on startup.
We are warm adherents of  Agile Development practices, and practitioners of  Extreme Programming. We believe that the Agile movement has improved the software quality situation a great deal, by moving testing to the centre of the development process and making developers directly responsible for verifying the quality of their code. Since 2000 we have been exploring different ways of creating high-level tests that communicate intent and can be understood and created by non-technical customers (Acceptance Tests). The front end and common factor is a tool called TextTest.
Verifying Application Behaviour with TextTest
As the name suggests, TextTest works via comparing plain text logged by programs with a previous 'gold standard' version of that text. This is in contrast to most acceptance testing frameworks on offer today, which generally use some form of hand-written 'assertions' by the test writer that call into an application API.
So, when your test fails and you click on it to see what went wrong, you might see this (Click to Enlarge):
On the left you see what we wanted the program to produce. On the right we see what actually happened. This is testing a small 'video store' application, and this test checks that the same movie cannot be added twice. Given what happened, it obviously can right now...
The focus is around testing a particular executable program with a variety of inputs. To start with, a plain text configuration file is created that tells TextTest about your program, how to run it, and how to test it. Tests (and test suites) are then defined entirely using plain text files in a directory structure.
A test is defined partly by the expected files and their contents that should be produced, and partly by the 'input' to provide, which can consist any or all of:
  • Options to be provided on the command line
  • A file to be redirected to standard input
  • Environment variables that should be set
  • A sequence of 'use-case' actions to be performed on a GUI (see  StoryText)
The application needs to write a log file describing what is happening, similar to the one shown above. Any output at all can be compared, so long as it is plain text, or can be converted to it.
For people wanting to test a GUI (custom or Web) you will need some scripting approach to that GUI so that tests can be run without needing somebody to click the buttons. For Python and Java GUIs we have the tool  StoryText, which is especially designed to work with TextTest.

 


















本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/6508375.html ,如需转载请自行联系原作者


相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
相关文章
|
19天前
|
Arthas 监控 Java
JVM知识体系学习七:了解JVM常用命令行参数、GC日志详解、调优三大方面(JVM规划和预调优、优化JVM环境、JVM运行出现的各种问题)、Arthas
这篇文章全面介绍了JVM的命令行参数、GC日志分析以及性能调优的各个方面,包括监控工具使用和实际案例分析。
36 3
|
23天前
|
SQL 分布式计算 NoSQL
大数据-170 Elasticsearch 云服务器三节点集群搭建 测试运行
大数据-170 Elasticsearch 云服务器三节点集群搭建 测试运行
35 4
|
20天前
|
测试技术 Python
自动化测试项目学习笔记(一):unittest简单运行(初始化,清除,设置测试行为)
本文介绍了Python的unittest框架的基础用法,包括测试初始化(setup)、清除(tearDown)函数的使用,以及assertEqual和assertGreaterEqual等断言方法,并展示了如何创建测试用例,强调了测试函数需以test_开头才能被运行。
46 0
自动化测试项目学习笔记(一):unittest简单运行(初始化,清除,设置测试行为)
|
29天前
|
安全 Linux 网络安全
Kali渗透测试:远程控制程序基础
Kali渗透测试:远程控制程序基础
19 0
Kali渗透测试:远程控制程序基础
|
29天前
|
安全 Java Linux
Kali渗透测试:通过Web应用程序实现远程控制
Kali渗透测试:通过Web应用程序实现远程控制
39 0
|
3月前
|
Linux API
在Linux中,程序产生了库日志虽然删除了,但磁盘空间未更新是什么原因?
在Linux中,程序产生了库日志虽然删除了,但磁盘空间未更新是什么原因?
|
3月前
|
数据库 Java 监控
Struts 2 日志管理化身神秘魔法师,洞察应用运行乾坤,演绎奇幻篇章!
【8月更文挑战第31天】在软件开发中,了解应用运行状况至关重要。日志管理作为 Struts 2 应用的关键组件,记录着每个动作和决策,如同监控摄像头,帮助我们迅速定位问题、分析性能和使用情况,为优化提供依据。Struts 2 支持多种日志框架(如 Log4j、Logback),便于配置日志级别、格式和输出位置。通过在 Action 类中添加日志记录,我们能在开发过程中获取详细信息,及时发现并解决问题。合理配置日志不仅有助于调试,还能分析用户行为,提升应用性能和稳定性。
50 0
|
3月前
|
Linux C#
【Azure App Service】C#下制作的网站,所有网页本地测试运行无误,发布至Azure之后,包含CHART(图表)的网页打开报错,错误消息为 Runtime Error: Server Error in '/' Application
【Azure App Service】C#下制作的网站,所有网页本地测试运行无误,发布至Azure之后,包含CHART(图表)的网页打开报错,错误消息为 Runtime Error: Server Error in '/' Application
|
23天前
|
XML JSON Java
Logback 与 log4j2 性能对比:谁才是日志框架的性能王者?
【10月更文挑战第5天】在Java开发中,日志框架是不可或缺的工具,它们帮助我们记录系统运行时的信息、警告和错误,对于开发人员来说至关重要。在众多日志框架中,Logback和log4j2以其卓越的性能和丰富的功能脱颖而出,成为开发者们的首选。本文将深入探讨Logback与log4j2在性能方面的对比,通过详细的分析和实例,帮助大家理解两者之间的性能差异,以便在实际项目中做出更明智的选择。
152 3
|
24天前
|
存储 缓存 关系型数据库
MySQL事务日志-Redo Log工作原理分析
事务的隔离性和原子性分别通过锁和事务日志实现,而持久性则依赖于事务日志中的`Redo Log`。在MySQL中,`Redo Log`确保已提交事务的数据能持久保存,即使系统崩溃也能通过重做日志恢复数据。其工作原理是记录数据在内存中的更改,待事务提交时写入磁盘。此外,`Redo Log`采用简单的物理日志格式和高效的顺序IO,确保快速提交。通过不同的落盘策略,可在性能和安全性之间做出权衡。
1597 14