admin 管理员组

文章数量: 887021


2023年12月19日发(作者:python怎么读取中文文件)

Difference between System testing and integration test

Integration Testing: Testing of combined parts of an application to determine if they function

together correctly. Usually performed after unit and functional testing. This type of testing is

especially relevant to client/server and distributed systems.

System Testing: Testing that attempts to discover defects that are properties of the entire

system rather than of its individual components.

Difference between black box testing and white box test

Black Box testing: we test the functionaliy of the application throughly with the help of

requirements. here we do not concern about the internal logic of the code. here we check the

system by giving the proper input whether it gives proper output or not. this work done by

the testers.

White Box testing: we more concern about internal logic of the program i.e; here we check

module interface local datastructures logical conditions on their true and false side loops etc;

designated and executed by the developers/SDET.

Difference between performance, load, and stress testing

Performance testing: Performance testing is used to show that after testing there is no defect

in the system or application. Load testing and stress testing are the parts of performance

testing.

Load Testing: Load testing is used to test the application under a range of loads in order to

determine at what point the system's response time degrades or fails.

For example,If an application is supports 500 users then test whether it supports the no of

users as specified.

Stress Testing: This testing is used to push the system beyond the limits of its specified

requirements to find the potentially harmful bugs. we can say that-"How much is too much

for the system".

Difference between function testing and regression testing

1 / 17

Functional Testing: This test is performed to see weather the program is working as per the

given flow. functionality is working correctly or not as per requiremnet.

Regression Testing: This test is performed during modification stage. where the applied

changes impact the change in working of the whole project or not. Means weather the

modification caused errors in existing working of the project or not

Difference between actual result and expect result

Actual result is the behavior produced/observed when a component or system is tested. It’s

like “what it actually look like” status.

Expect result is the behavior predicted by the specification of the component or system under

specified conditions. It’s like “what it suppose to be” status

Did white box testing means testing of code

Yes ,it test the logic of the code

What are the critical things you listed in the performance test result

1. Concurrent users

2. Throughout

3. Server status such as CPU usage,Memory

4. Response times

5. Time lapses

6. Test environment

What are contents of defects/bugs

A software bug is the common term used to describe an error flaw, mistake, failure, or fault

in a computer program or system that produces an incorrect or unexpected result, or causes

it to behave in unintended ways.

Content of bugs

1. Bug ID

2. Bug Title

3. Summary: expected result, actual result

4. Priority

2 / 17

5. Severity

6. Status:Open/fix/close/holdon/non-reproduce

7. Software Version

8. Platform and OS

9. Component

10. Assign To

11. Environment

12. Reproduce Steps

13. Supporting files, such as snapshot

What are contents of test cases

1. Test Case ID:

2. Case Name

3. Priority

4. Test step

5. Test Execution

6. Expected Results

7. Actual Results

8. Revision history

9. Environment

10. Run time

11. Name of tester, date

What is test plan? Have you ever written test plan?

A test plan is a document detailing a systematic approach to testing a system such as a

machine or software.

Contents of test plan:

1. Test scope

2. Test strategy: integrate testing, system testing, performance testing, security testing

3. Test Risk

4. Test resource

5. Test time line

3 / 17

6. Sign off critical

What is the scope of testing

The scope of testing is the boundaries of testing, what will be tested and what will not be

tested

.What does your test report look like

1. the scope of testing

2. test enviroment

3. Detailed Test result:the case execution and their status

4. bug quantity and severity

5. Suggestion

What is bug triage and triage group? How to resolve conflict when verifying it is a bug or

not

Triage is a process of identify or verify the bugs based on the information of the bug.

Whenever we have disagreement to indentify the bug or for a very complex bug, we assign

the bug to the triage group, a group of Sr. developers, testers, and leads, to verify it.

How to know your test cases are too many or too less

Verify the test cases against the scope of the testing and function requirement

How to ensure the test coverage

1. Ensure that the documents defining the business and customer requirements are

complete and correct.

2. Ensure that testers themselves have thoroughly read and understood the documents.

3. Prepare a clear cut scope of testing based on product documents.

4. The strategy and Test Planning is as per system requirements.

5. Decide test methodology and test tools (if any), and test schedule.

6. Prepare Test Cases based on business rules and customer requirements.

7. Ensure that the test cases are extensive and sensible to cover the complete

requirements testing.

8. Ensure that during testing no changes in the test environment (coding etc.) is done

by development team.

4 / 17

9. Ensure that development team representatives (1 or all) are present during the

complete testing.

10. Create Test Scenarios based on test cases.

11. Observe the result of each test case and record it accordingly.

12. Prepare a comprehensive and detailed test report explaining each of the test case,

scenario and its result elaborately.

13. Ensure that all bugs reported should make sense, no duplication/overlapping

14. The final report submitted should clearly state the areas, reason, impact not covered

under testing if avaliable.

15. Ensure that you have a tentative plan from the dev team when they're fixing all bugs

and submitting it back to testing team.

16. Verify all bugs fixed and ensure that the development team is sitting with testers

during verification.

How to make sure/verify that your testers are blocked by error

1. Verify the build by running build verification test cases

2. Verify the test case steps, script, and data. If the data is spoofed, we also need to

verify the script for spoofing the data

3. Rerun the test cases by other tester (other environment if there is as alternative) for

double check

When should testing be stopped?

1. all the testcases are executed

2. Defect rate follows down below the criteria,Bug rate falls down below the criteria

3. dead line comes

LR面试题

What is load testing?

Load testing is to test that if the application works fine with the loads that result from large

number of simultaneous users, transactions and to determine weather it can handle peak

usage periods.

5 / 17

What is Performance testing?

Timing for both read and update transactions should be gathered to determine whether

system functions are being performed in an acceptable timeframe. This should be done

standalone and then in a multi user environment to determine the effect of multiple

transactions on the timing of a single transaction.

Explain the Load testing process?

Step 1: Planning the test. Here, we develop a clearly defined test plan to ensure the test

scenarios we develop will accomplish load-testing objectives.

Step 2: Creating Vusers. Here, we create Vuser scrīpts that contain tasks performed by each

Vuser, tasks performed by Vusers as a whole, and tasks measured as transactions.

Step 3: Creating the scenario. A scenario describes the events that occur during a testing

session. It includes a list of machines, scrīpts, and Vusers that run during the scenario. We

create scenarios using LoadRunner Controller. We can create manual scenarios as well as

goal-oriented scenarios. In manual scenarios, we define the number of Vusers, the load

generator machines, and percentage of Vusers to be assigned to each scrīpt. For web tests,

we may create a goal-oriented scenario where we define the goal that our test has to achieve.

LoadRunner automatically builds a scenario for us.

Step 4: Running the emulate load on the server by instructing multiple Vusers

to perform. tasks simultaneously. Before the testing, we set the scenario configuration and

scheduling. We can run the entire scenario, Vuser groups, or individual Vusers.

Step 5: Monitoring the monitor scenario execution using the LoadRunner

online runtime, transaction, system resource, Web resource, Web server resource, Web

application server resource, database server resource, network delay, streaming media

resource, firewall server resource, ERP server resource, and Java performance monitors.

Step 6: Analyzing test results. During scenario execution, LoadRunner records the

performance of the application under different loads. We use LoadRunner’s graphs and

reports to analyze the application’s performance.

When do you do load and performance Testing?

6 / 17

perform. load testing once we are done with interface (GUI) testing. Modern system

architectures are large and complex. Whereas single user testing primarily on functionality

and user interface of a system component, application testing focuses on performance and

reliability of an entire system. For example, a typical application-testing scenario might

depict 1000 users logging in simultaneously to a system. This gives rise to issues such as what

is the response time of the system, does it crash, will it go with different software

applications and platforms, can it hold so many hundreds and thousands of users, etc. This

is when we set do load and performance testing.

What are the components of LoadRunner?

The components of LoadRunner are The Virtual User Generator, Controller, and the Agent

process, LoadRunner Analysis and Monitoring, LoadRunner Books Online.

What Component of Load Runner would you use to record a script? - The Virtual User

Generator (VuGen) component is used to record a scrīpt. It enables you to develop Vuser

scripts for a variety of application types and communication protocols.

What Component of LoadRunner would you use to play Back the scrīpt in multi user mode?

The Controller component is used to playback the scrīpt in multi-user mode. This is done

during a scenario run where a vuser scrīpt is executed by a number of vusers in a group.

What is a rendezvous point?

You insert rendezvous points into Vuser scrīpts to emulate heavy user load on the server.

Rendezvous points instruct Vusers to wait during test execution for multiple Vusers to

arrive at a certain point, in order that they may simultaneously perform. a task. For

example, to emulate peak load on the bank server, you can insert a rendezvous point

instructing 100 Vusers to deposit cash into their accounts at the same time.

What is a scenario?

A scenario defines the events that occur during each testing session. For example, a scenario

defines and controls the number of users to emulate, the actions to be performed, and the

machines on which the virtual users run their emulations.

7 / 17

Explain the recording mode for web Vuser scrīpt?

We use VuGen to develop a Vuser scrīpt by recording a user performing typical business

processes on a client application. VuGen creates the scrīpt by recording the activity between

the client and the server. For example, in web based applications, VuGen monitors the client

end of the database and traces all the requests sent to, and received from, the database

server. We use VuGen to: Monitor the communication between the application and the

server; Generate the required function calls; and Insert the generated function calls into a

Vuser scrīpt.

Why do you create parameters?

Parameters are like scrīpt variables. They are used to vary input to the server and to

emulate real users. Different sets of data are sent to the server each time the scrīpt is run.

Better simulate the usage model for more accurate testing from the Controller; one scrīpt

can emulate many different users on the system.

What is correlation? Explain the difference between automatic correlation and manual

correlation?

Correlation is used to obtain data which are unique for each run of the scrīpt and which are

generated by nested queries. Correlation provides the value to avoid errors arising out of

duplicate values and also optimizing the code (to avoid nested queries). Automatic

correlation is where we set some rules for correlation. It can be application server specific.

Here values are replaced by data which are created by these rules. In manual correlation,

the value we want to correlate is scanned and create correlation is used to correlate.

How do you find out where correlation is required? Give few examples from your projects? -

Two ways: First we can scan for correlations, and see the list of values which can be

correlated. From this we can pick a value to be correlated. Secondly, we can record two

scrīpts and compare them. We can look up the difference see for the values which needed to

be correlated. In my project, there was a unique id developed for each customer, it was

8 / 17

nothing but Insurance Number, it was generated automatically and it was sequential and

this value was unique. I had to correlate this value, in order to avoid errors while running

my scrīpt. I did using scan for correlation.

Where do you set automatic correlation options?

Automatic correlation from web point of view can be set in recording options and

correlation tab. Here we can enable correlation for the entire scrīpt and choose either issue

online messages or offline actions, where we can define rules for that correlation. Automatic

correlation for database can be done using show output window and scan for correlation

and picking the correlate query tab and choose which query value we want to correlate. If

we know the specific value to be correlated, we just do create correlation for the value and

specify how the value to be created.

What is a function to capture dynamic values in the web Vuser scrīpt? -

Web_reg_save_param function saves dynamic data information to a parameter.

When do you disable log in Virtual User Generator, When do you choose standard and

extended logs?

Once we debug our scrīpt and verify that it is functional, we can enable logging for errors

only. When we add a scrīpt to a scenario, logging is automatically disabled. Standard Log

Option: When you select

Standard log, it creates a standard log of functions and messages sent during scrīpt

execution to use for debugging. Disable this option for large load testing scenarios. When

you copy a scrīpt to a scenario, logging is automatically disabled Extended Log Option:

Select

extended log to create an extended log, including warnings and other messages. Disable this

option for large load testing scenarios. When you copy a scrīpt to a scenario, logging is

automatically disabled. We can specify which additional information should be added to the

extended log using the Extended log options.

9 / 17

How do you debug a LoadRunner scrīpt?

VuGen contains two options to help debug Vuser scrīpts-the Run Step by Step command

and breakpoints. The Debug settings in the Options dialog box allow us to determine the

extent of the trace to be performed during scenario execution. The debug information is

written to the Output window. We can manually set the message class within your scrīpt

using the lr_set_debug_message function. This is useful if we want to receive debug

information about a small section of the scrīpt only.

How do you write user defined functions in LR? Give me few functions you wrote in your

previous project?

Before we create the User Defined functions we need to create the external

library (DLL) with the function. We add this library to VuGen bin directory. Once the

library is added then we assign user defined function as a parameter. The function should

have the following format: __declspec (dllexport) char* (char*,

char*)Examples of user defined functions are as follows:GetVersion, GetCurrentTime,

GetPltform. are some of the user defined functions used in my earlier project.

What are the changes you can make in run-time settings?

The Run Time Settings that we make are: a) Pacing - It has iteration count. b) Log - Under

this we have Disable Logging Standard Log and c) Extended Think Time - In think time we

have two options like Ignore think time and Replay think time. d) General - Under general

tab we can set the vusers as process or as multithreading and whether each step as a

transaction.

Where do you set Iteration for Vuser testing?

We set Iterations in the Run Time Settings of the VuGen. The navigation for this is Run time

settings, Pacing tab, set number of iterations.

How do you perform. functional testing under load?

10 / 17

Functionality under load can be tested by running several Vusers concurrently. By

increasing the amount of Vusers, we can determine how much load the server can sustain.

What is Ramp up? How do you set this?

This option is used to gradually increase the amount of Vusers/load on the server. An initial

value is set and a value to wait between intervals can be

specified. To set Ramp Up, go to ‘Scenario Scheduling Options’

安全测试试题;

SQL注入的工作原理?

LR试题

性能测试中,如何处理口令登录情况?

在访如果网站使用了域验证方式,访问时会弹出一个对话框,要求用户名、口令、域名。在使用VU Generator 进行录制是无法录制到用户输入的用户名和口令的情况下需要用户使用LR提供的函数进行处理。

函数为Web_set_user,访问指定的URL之前先用函数设定访问URL需要的用户名和口令

web_set_user(“domainuser”, “password”, “”);

LR开启线程和开启进程的区别?

选择进程,场景运行时会为每一个虚拟用户创建一个进程,当以10个VU用户并发,就会在任务管理器中出现10个mmdrv进程;选择线程,则将每个虚拟用 户作为一个线程来运行,在任务管理器中只看到一个,一个进程可以支持50VU的线程并发,使用多线程的方法能使每台负载生成器运行更多 的VU,但是只有支持线程安全的协议,才能使用LR的VU并发方式,这种方式的运行效率更高,能造成更大的压力。

每个Vuser,则对于每个Vuser实例,都将反复启动同一驱动程充并将其加载到内存中.将同一驱动程序加载到内存中会占用大量RAM(随机存取存储器)及其他系统资源.这就限制了可以在任一负载生成器上运行的Vuser 的数量.如果按线程运行每个Vuser,controller为每50个Vuser(默认情况下)仅启动驱动程序(如)的一个实例.该驱动进程/程序将启动几个Vuser, 每个Vuser都按线程进行.这些线程11 / 17

Vuser将共享父驱动进程的内存段.这就消除了多次重新加载驱动程序/进程的需要,节省了大量内存空间,从而可以在一个负载生成器上运行更多的Vuser.

但是任何选择都是有两面性的。选择线程方式运行Vuser会带来一些安全问题。因为线程的资源是从进程资源中分配出来的,因此同一个进程中的多个线程会有共享的内存空间,这样可能会引起多个线程的同步问题,调度不好,就会出问题,不如A线程要用的资源就必须等待B线程释放,而B也在等待其他资源释放才能继续。这就会出现这样的问题:同一个测试场景,用线程并发就会超时失败或报错,而用进程并发就没错。

2.性能测试包含了哪些测试(至少举出3种)

压力测试、负载测试、并发测试、可靠测试、失效恢复测试。

3.简述性能测试的步骤

Step 1. Identify the Test Environment

Step 2. Identify Performance Acceptance Criteria

Step 3. Plan and Design Tests

Step 4. Configure the Test Environment

Step 5. Implement the Test Design

Step 6. Execute the Test

Step 7. Analyze Results, Report, and Retest

4.简述使用Loadrunner的步骤

脚本录制设置—录制脚本—调试脚本—场景设置—结果分析

5.什么时候可以开始执行性能测试?

在产品相对比较文档,功能测试完成后。灵活性比较强。

nner由哪些部件组成?

virtual user generator

contorller

analysis

7.你使用LoadRunner的哪个部件来录制脚本?

virtual user generator

nner的哪个部件可以模拟多用户并发下回放脚本?

contorller

12 / 17

9.什么是集合点?设置集合点有什么意义?Loadrunner中设置集合点的函数是哪个?

集合点:设置多个用户到达某个用户数量点集合,同时触发一个事务,以达到模拟真实环境下同时多个用户操作,同时模拟负载,实现性能测试的最终目的

LR_rendezvous(“集合点名称”)

10.什么是场景?场景的重要性有哪些?如何设置场景?

场景:模拟真实环境中,用户运行状况。

1.通过场景来模拟实际用户的操作,性能测试结果才具有代表性。

2.在运行过程中也需要关注场景性能测试值,测试过程是否正常。

1.选择场景中需要的脚本

2.选择为目标场景,还是指定的手工场景

3.设置用户数、设置产生负载的设备

4.设置执行策略

milan

2010-1-22 19:29:27

11.请解释一下如何录制web脚本?

LR通过转发请求,来捕获数据包,来形成脚本

12.为什么要创建参数?如何创建参数?

参数:在环境变化时必须时脚本具有环境变化的能力,就需要参数化(客户端发送到服务器端)

1.确定要参数话的数据

2.设定规则形式来取值

13.什么是关联?请解释一下自动关联和手动关联的不同。

关联:很多构架用sessionid等方法标识不同任务和数据,应用在每次运行时方式发送数据不完全相同,

需要利用的机制对录制的脚本进行处理,这种机制叫做关联(服务端发送到客户端)

14.你如何找出哪里需要关联?请给一些你所在项目的实例。

用户登陆,

客户端发送请求后,服务端验证正确性后,发送给客户端sessionid,是某种规则产生。

13 / 17

15.你在哪里设置自动关联选项?

两地方可以设置

1.设置允许录制时进行自动关联,可以自定义规则

2.录制完成后,vuser-scan action for correlations

16.哪个函数是用来截取虚拟用户脚本中的动态值?(手工关联)

17.你在VUGen中何时选择关闭日志?何时选择标准和扩展日志?

Run-time,log,

当调试脚本时,可以只输出错误日志,当在场景找你管加载脚本时,日志自动变为不可用。

Standard Log Option:选择标准日志时,就会在脚本执行过程中,生成函数的标准日志并且输出信息,供调试用。大型负载测试场景不用启用这个选项。

扩展日志包括警告和其他信息。大型负载测试不要启用该选项。用扩展日志选项,可以指定哪些附加信息需要加到扩展日志中

18.你如何调试LoadRunner脚本?

VuGen有两个选项帮助调试Vuser脚本。Run Step by Step 命令和断点(breakpoints)。Option对话框中的调试设置(Debug setting)项,可以确定在场景执行过程中执行轨迹范围。 调试信息写在output窗口。可以用

lr_set_debug_messag函数在脚本中手工设置信息类型。如果我们只想接收到一小段脚本的调式信息。

19.你在LR中如何编写自定义函数?请给出一些你在以前进行的项目中编写的函数。

在创建用户自定义函数前我们需要和创建DLL(external libary)。把库放在VuGen

bin 目录下。一旦加了库,把自定义函数分配做一个参数。该函数应该具有一下格式:__declspec (dllexport) char* (char*, char*)。

milan

2010-1-22 19:30:10

23.什么是逐步递增?你如何来设置?

Ramp up这个选项用于逐渐增加服务器的虚拟用户数或负载量。设置一个初始值而且可以在两个迭代之间设置一个值等待。设置Ramp up,请到‘Scenario Scheduling

14 / 17

Options’。

24.以线程方式运行的虚拟用户有哪些优点?

VuGen提供了用多线程的便利。这使得在每个生成器上可以跑更多的虚拟用户。如果是以进程的方式跑虚拟用户,为每个用户加载相同的驱动程序到内存中,因 此占用了大量的内存。这就限制了在单个生成器上能跑的虚拟用户数。如果按进程运行,给定的所有虚拟用户数(比如100)只是加载一个驱动程序实例到内存 里。每个进程共用父驱动程序的内存,因此在每个生成器上可以跑更多的虚拟用户。

25.当你需要在出错时停止执行脚本,你怎么做?

lr_abort函数放弃虚拟用户脚本的执行。说明虚拟用户停止Action的执行,直接执行vuser_end 然后结束执行。在出现错误情况下想手工放弃脚本的执行,这个函数是有用的。用这个函数停止脚本时,Vuser被指定为“Stopped”状态。为了这个函 数起作用,开始时候就不能选择Run-Time Settings中的Continue on error选项

26.响应时间和吞吐量之间的关系是什么?

吞吐量图显示的是虚拟用户每秒钟从服务器接收到的字节数。当和响应时间比较时,可以发现随着吞吐量的降低,响应时间也降低,同样的,吞吐量的峰值和最大响 应时间差不多在同时出现。

27.说明一下如何在LR中配置系统计数器?

通过Web资源监视器,利用这些监控器可以分析web服务器的吞吐量、点击率、每秒http响应数以及每秒下载的页面数。

37.什么是think time?think_time有什么用?

思考时间是真实用户在action之间等待的时间。例如:当一个用户从服务器接收到数据时,用户可能需要在响

应之前等待几分钟回顾数据,这种推迟被称为思考时间。

15 / 17

38.标准日志和扩展日志的区别是什么?

Standard Log Option:选择标准日志时,就会在脚本执行过程中,生成函数的标准日志并且输出信息,供调试

用。大型负载测试场景不用启用这个选项。

扩展日志包括警告和其他信息。大型负载测试不要启用该选项。用扩展日志选项,可以指定哪些附加信息需要

加到扩展日志中

39.解释以下函数及他们的不同之处。

Lr_debug_message

lr_debug_message 函数在指定的消息级别

// 处于活动状态时发送一条调试消息。如果指定的

// 消息级别未处于活动状态,则不发出消息。

Lr_output_message

要发送不是特定错误消息的特殊通知,

Lr_error_message

函数将错误消息发送到

// 输出窗口和 Vuser 日志文件

Lrd_stmt lrd_exec 函数执行 lrd_stmt 设置的 SQL 语句。

Lrd_fetch 函数从结果集中提取后续若干行

result set.

函数准备用于

// 通过光标输出字符串(通常为 SQL 语句)

// 的下一结果集。对于 CtLib,它发出 ct_result

// 命令,并且在 ODBC 中它运行用于当前数据库

40.什么是吞吐量?

单位时间内系统处理客户端的请求数。

41.场景设置有哪几种方法?

目标场景,手工场景

16 / 17

17 / 17


本文标签: 用户 测试 脚本