发布新日志

  • 静态质量分析

    2007-06-06 17:02:34

    静态结构分析常需使用软件工具进行,包括控制流分析、数据流分析、接口分析、表达式分析

    产生的图表有:系统结构图、函数调用关系图、文件调用关系图、模块控制流图、类关系图

    规则(Metrics):量化的行为规范
    分类标准(Criteria):由一系列质量规则组成
    质量因素(Factor):依据各分类标准取值组合权重来计算

    Line复杂度、Halstead复杂度、McCabe复杂度

    经验显示:McCabe圈复杂度与错误发生率密切相关
    圈复杂度可以很好的预测
    错误发生的可能性
    代码可被理解的程度
    维护的工作量
    调试的容易程度

    基本复杂度(Essential Complexity) ev(g)
    依照结构化原则简化模块流程后,模块的复杂度,用于衡量程序非结构化程度
    优点:
    量化了软件结构化的程度
    显示了代码的质量
    预测维护时的工作量
    有助于软件的模块化设计

    规则Kiviat图

    分类标准Kiviat图,得出function_testability,function_stability,function_changeability,function_analyzability,synthesis

  • PL/SQL学习笔记(六)

    2007-06-05 23:38:22

    1. 一次插入两条数据的INSERT 语句示例:

    INSERT INTO employee (emp_id, emp_name)
    select 1,'Jessica Loraine' from dual union all
    select 2,'Kurt Roberts' from dual ;

    2. 声明记录变量:

    TYPE emp_pay_info IS RECORD

    (emp_id INTEGER,

    emp_name VARCHAR(32),

    pay_rate NUMBER(9,2),

    pay_type CHAR(1)

    );

    3. 如果使用的是记录,并且希望一些字段的定义与数据库表中列的定义相同,则可以用%TYPE属性(%TYPE可用于任何变量声明中,而不仅仅是记录中)

    variable_name table_name.column_name%TYPE;

    4. 可以使用%ROWTYPE属性声明一个基于表的记录

    table_name%ROWTYPE

    5. 伪列

    CURRVAL,NEXTVAL,ROWID,ROWNUM

    INSERT INTO employee

    VALUES (emp_id_seq.NEXTVAL, 'Stanton Bernard');

    ROWID伪列表示表中记录的二进制地址,可以用UROWID类型的变量以可读的格式存储rowid。

    ROWNUM伪列指出从表中检索数据的次序。

    6. 事务控制语句确保使用数据操纵语句时的数据完整性。即当使用SELECT/UPDATE/INSERT和DELETE语句时,程序员将插入合适的事务控制语句,以确保数据是准确的,并防止数据遭到破坏。

  • PL/SQL学习笔记(五)

    2007-06-05 22:45:00

    1. 包是一个封装的相关schema对象的集合。这些对象包括过程、函数、变量、常量、游标和异常。

    2. 包具有下述优点:

    使您能够更有效地将应用程序组织成模块。每个包都易于理解,包之间的接口简单、明了、定义完善

    允许您高效的授予权限

    在会话期间,包的公用变量和游标持续可用,因此所有的游标以及在这种环境中执行的过程可以共享它们。

    使您能够重载过程和函数

    通过一次将多个对象加载到内存中改善了性能,因此以后对包中相关子程序的调用不需要进行输入/输出操作。

    通过使用包含存储过程和函数的库,提高了代码的重用性,消除了重复性编码工作。

    3. 创建包的第一步是创建其规范,规范将在包体中定义的模式对象声明为公用的。

    创建包体:

    CREATE [OR REPLACE] PACKAGE BODY package_name {IS|AS}

    [package body object declaration]

    BEGIN

    programming statements

    END [package_name];

    4. 可以使用包含compile关键字的ALTER PACKAGE命令重新编译包。这种显式的重新编译消除了运行阶段的隐式重新编译,并防止了任何相关的运行阶段编译错误以及性能开销。通常在修改包后,显式地重新编译它。

    ALTER PACKAGE employee_maint compile body

    ALTER PACKAGE employee_maint compile package

    第一句只重新编译包体,第二条重新编译整个包,包括包体和规范

    5. 任何在包规范中声明的项目在包外都是可见的。这使得包外的PL/SQL代码能够引用包内的对象。在包规范中声明的对象被称为公有的;在包体中声明的对象只能在包中使用,因此包外PL/SQL块不能引用任何在包内私自声明的变量。

    6. 对于独立的过程,变量、游标和常量只在过程调用期间是持续的,当过程终止后,它们便消失了;如果变量、常量或游标是在包规范或者包体中声明的,则在用户的会话期间,它们的值是持续的;当当前用户的会话终止或重新编译包时,它们的值便消失。

    7. 包要么是有效的,要么是无效的。如果最后一次编译包后,其源代码和它引用对象没有被删除、替换或修改,则这个包被认为是有效的。如果最后一次编译包后,其源代码或它引用的对象被删除、替换或修改,则这个包被认为是无效的。

  • [转]等价类划分准则

    2007-06-05 11:16:18

    等价类划分准则:

    • 如果输入条件规定了取值范围,可定义一个有效等价类和两个无效等价类
    • 如果输入条件代表集合的某个元素,则可定义一个有效等价类和一个无效等价类
    • 如规定了输入数据的一组值,且程序对不同输入值做不同处理,则每个允许的输入值是一个有效等价类,并有一个无效等价类 (所有不允许的输入值的集合)。
    • 如果规定了输入数据必须遵循的规则,可确定一个有效等价类(符合规则)和若干个无效等价类(从不同角度违反规则)
    • 如已划分的等价类各元素在程序中的处理方式不同,则应将此等价类进一步划分成更小的等价类
  • [转]在XP Home 上装Rose

    2007-06-04 22:18:49

    我在笔记本上安装Rational Rose 2003时,系统提示:操作系统不支持安装。我笔记本用的是Windows XP home版操作系统。我去Rational官方网站上查找发现Rational Rose 2003 不支持XP home版操作系统。经过一番研究,给出了如下解决方案:
    安装时让Rational Rose 2003不对操作系统版本进行检测。
    步骤如下:
    1、去
    http://www.newhua.com/cfan/200510/orca.rar 下载Microsoft Orca,Orca数据库编辑器是 Windows Installer SDK 中提供的表编辑工具,可以用于编辑 .msi 文件。(也可以去 http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en 下载)
    2、双击\bin 文件夹中的 Orca.msi 文件,安装 Orca 编辑器。
    3、用Orca打开Setup/rose.msi,查找"xph",会定位到该行:
    (VersionNT AND (NOT RSWINXPHOME))OR (DISABLE_PLATFORM_BLOCKS = 1)|You are attempting to install on an...
    4、用Table/drop row删除该行,保存该文件,退出
    5、安装Rational Rose 2003,成功!

     

    (参考:http://support.microsoft.com/kb/255905/zh-cn)

  • PL/SQL学习笔记(四)

    2007-06-04 11:59:47

    1. 当子程序使用参数列表中引用的变量或表达式调用函数时,这些参数被称为实参,在这种情况下,参数实际上将参数值保存在内存中;如果变量或表达式是在子程序规范中声明,并在子程序主体中引用时,则参数称为形参,在这种情况下,内存中保存的是指向真正的参数值的指针.

    2. 定义函数中的参数类型时,如果要接受一个来自表中的参数,并且不想对参数类型使用硬编码,因为以后可能会改变——只需在参数后面添加%TYPE,以便从表中获得字段类型即可。例如下面一行代码将参数p_emptype的数据类型设置为表employee中pay_type字段的类型

    (p_emptype employee.pay_type%TYPE)

    3. 当参数中包含大型值、表达式或记录时,将对性能造成极大的影响。将这些数据拷贝到参数中需要花费时间。程序员提高程序性能的一种方法是在模式语句中使用NOCOPY提示。

    使用NOCOPY提示时,您指导(而不是命令)编译器按引用(而不是按值)传递参数

    4. 存储函数是一个保存在数据库中的函数,可以被PL/SQL代码调用。函数和存储函数的唯一区别是,在关键字FUNCTION加上CREATE [OR REPLACE]关键字。

    5. 使用EDIT FUNCTION_NAME;修改函数代码后,必须将它重新装载到缓冲区中(GET FUNCTION_NAME),然后输入/并按回车执行

    6. 缺省情况下,函数执行时,其权限与函数的定义者相同,而不是调用者.定义者的权限受它所在的schema约束,您可以在PL/SQL完全限定对象名称,以便能够修改其他schema中的表.但是,这会限制您代码的移植性.

    Oracle允许您使用调用者权限调用函数.在这种情况下,您不受schema的约束,而是受调用者权限的约束。您可以通过AUTHID子句使用调用者权限,如:

    CREATE OR REPLACE FUNCTION mypi

      AUTHID CURRENT_USER AS

    BEGIN

      NULL;

      RETURN 3.14;

    END;

    7. ORACLE SCHEMA OBJECT的定义

    A schema is a collection of database objects. A schema is owned by a database user and has the same name as that user. Schema objects are logical structures created by users to contain, or reference, their data. Schema objects include structures like tables, views, and indexes. You can create and manipulate schema objects using Oracle Enterprise Manager.

  • PL/SQL学习笔记(三)

    2007-06-03 16:58:55

    1.在比较两个CHAR数据类型时,Oracle使用空白填补比较语义(blank-padded comparison semantics)。这意味着Oracle在较短的字符串的尾部概念性地填补足够的空格,使之与较长的字符串等长,然后进行比较,比较两个字符串常量时,Oracle也这么做,然而当其中一个值为变长字符串时,Oracle使用不填补比较语义(non-padded comparison semantics),因此字符串尾部的空格影响比较结果。

    2.三值逻辑真值表

    操作符         表达式           结果

    AND           TRUE AND TRUE     TRUE

                  TRUE AND FALSE    FALSE

                  TRUE AND NULL     NULL

                  FALSE AND NULL    FALSE

                  NULL AND NULL     NULL

    OR            TRUE OR TRUE      TRUE

                  TRUE OR FALSE     TRUE

                  TRUE OR NULL      TRUE

                  FALSE OR NULL     FALSE

                  NULL OR NULL      NULL 

    NOT           NOT TRUE          FALSE

                  NOT FALSE         TRUE 

                  NOT NULL          NULL

    3. 检查空值时一定要使用IS NULL 操作符,而不要使用相等或不等操作符比较变量和空值

    4. 当参数为空值时,内置函数NVL让您指定使用另一个值。语法类似于:

       NVL(expression, value_if_expression_is_null)

  • PL/SQL学习笔记(二)

    2007-06-01 15:45:40

    1. 比较CHAR字符串和VARCHAR2字符串时,应该像下面这样使用rtrim函数清除CHAR字符串后面的空格

    IF RTRIM(employee_name_c)=employee_name_v THEN_

    2. 可以使用trunc()函数裁剪日期DATE变量,使之不包含时间部分

  • PL/SQL学习笔记(一)

    2007-05-31 22:52:21

    1. PL/SQL是Oracle对SQL扩展的过程性语言,与SQL不同,PL/SQL是过程性的,而不是声明性的,这意味着代码规定了如何完成工作。

    2.使用dbms_output.put_line()来打印数据时,需要先用SET SERVEROUTPUT ON把服务器输出选项打开

    3.执行SQL*PLUS命令执行文件test.sql:

    SQL> @c:\a\test

    4.可以使用SHOW ERRORS命令查看错误的详细信息

    5.调用不带参数的函数必须确保不添加圆括号

    6.显示函数返回值可以使用:SELECT FUNC_NAME FROM DUAL;(DUAL时一个总是存在的特殊的Oracle表,它总是只有一行一列。从DUAL表中选择函数即可显示函数的结果)

    7.在过程生成器中执行PL/SQL时,需要把dbms_output.put_line替换为text_io.put_line(由于dbms_ouput是一个只存在于数据库服务器中的包),另外,和SQL*PLUS不同,不需要输入斜杠来告诉过程生成器已经输入完了PL/SQL块。

     

  • Oracle用户密码及权限相关Tips

    2007-05-31 22:06:11

    1.忘记密码时,可以用
    sqlplus /nolog
    conn / as sysdba
    startup (如果数据库不是处于启动状态则启动)
    alter user sys identified by abcdef
    然后就可以使用sys用户密码登陆了

    之后可以修改其他用户的密码。

    (或者用orapwd.exe命令,可以修改命令。
    orapwd file='/oracle/pwdsid.ora'  password=123456
    这个命令是修改sys用户的密码。你把生成的文件覆盖原来的密码文件。除sys和system其他用户的密码不会改变。没试验过)

    2.SQLPLUS下查看有哪些用户:
    select * from all_users;

    删除用户:
    DROP USER username CASCADE; //CASCADE为可选项
    创建用户:

    CREATE USER sidney
    IDENTIFIED BY welcome
    DEFAULT TABLESPACE cases_ts
    QUOTA 10M ON cases_ts
    QUOTA 5M ON temp_ts
    QUOTA 5M ON system
    PROFILE engineer
    PASSWORD EXPIRE;
    还有其它的关键字,可以查oracle的联机文档。

    3.如果出现user lacks create session privilege错误,可以用grant create to username;授予权限

    4.如果出现类似ORA-01950:表空间'SYSTEM'中无权限,可以用grant connect, rescource to username;授予权限

     

     

     

  • QTP Interview Questions

    2007-05-29 21:32:44

    http://www.geekinterview.com/articles/qtp-interview-questions.html

    These are just a few sample questions I would ask a candidate on QTP Test Automation:

    1. What is the file extension of the code file & object repository file in QTP?

    2. Explain the concept of object repository & how QTP recognises objects?

    Object Repository: displays a tree of all objects in the current component or in the current action or entire test( depending on the object repository mode you selected). 
    we can view or modify the test object descrīption of any test object in the repository or to add new objects to the repository. 
    Quicktest learns the default property values and determines in which test object class it fits.If it is not enough it adds assistive properties, one by one to the descrīption until it has compiled the unique descrīption.If no assistive properties are available, then it adds a special Ordianl identifier such as objects location onthe page or in the source code.

    When you create test,all the information about the objects in your test is stored in object repository. There are two types of object Repositories  
    1. Shared object repository 
    2. Per action repository

    3. What are the properties you would use for identifying a browser & page when using descrīptive programming ?

    4. What are the different scrīpting languages you could use when working with QTP ?

    5. Give me an example where you have used a COM interface in your QTP project?

    6. Few basic questions on commonly used Excel VBA functions.

    7. Explain the keyword createobject with an example.

    8. Explain in brief about the QTP Automation Object Model.

    Essentially all configuration and run functionality provided via the QuickTest interface is in some way represented in the QuickTest automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QuickTest have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods.  
    You can use the objects, methods, and properties exposed by the QuickTest automation object model, along with standard programming elements such as loops and conditional statements to design your program 

    1. How Does Run time data (Parameterization) is handled in QTP?

    A) You can then enter test data into the Data Table, an integrated

    spreadsheet with the full functionality of Excel, to manipulate data

    sets and create multiple test iterations, without programming, to

    expand test case coverage. Data can be typed in or imported from

    databases, spreadsheets, or text files.

     

    2) What is keyword view and Expert view in QTP?

    A) QuickTest’s Keyword Driven approach, test automation experts

    have full access to the underlying test and object properties, via an

    integrated scrīpting and debugging environment that is round-trip

    synchronized with the Keyword View.

    Advanced testers can view and edit their tests in the Expert View,

    which reveals the underlying industry-standard VBscrīpt that

    QuickTest Professional automatically generates. Any changes

    made in the Expert View are automatically synchronized with the

    Keyword View.

     

    3) Explain about the Test Fusion Report of QTP ?

    A) Once a tester has run a test, a TestFusion report displays all

    aspects of the test run: a high-level results overview, an expandable

    Tree View of the test specifying exactly where application failures

    occurred, the test data used, application screen shots for every step

    that highlight any discrepancies, and detailed explanations of each

    checkpoint pass and failure. By combining TestFusion reports with

    QuickTest Professional, you can share reports across an entire QA

    and development team.

     

    4) To which environments does QTP supports ?

    A) QuickTest Professional supports functional testing of all enterprise

    environments, including Windows, Web, ..NET, Java/J2EE, SAP,

    Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe

    terminal emulators, and Web services.

     

    5) What is QTP ?

    A) QuickTest is a graphical interface record-playback automation tool.   It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, QuickTest Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and .NET framework applications...

      

    6) Explain QTP Testing process ?

    A) The QuickTest testing process consists of 6 main phases:

    Create your test plan
    Prior to automating there should be a detailed descrīption of the test including the exact steps to follow, data to be input, and all items to be verified by the test.  The verification information should include both data validations and existence or state verifications of objects in the application.

    Recording a session on your application
    As you navigate through your application, QuickTest graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.

    Enhancing your test
    Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly.
    NOTE:  Checkpoints can be added to a test as you record it or after the fact via the Active Screen.  It is much easier and faster to add the checkpoints during the recording process.

    Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data.
    Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.
    Debugging your test
    If changes were made to the scrīpt, you need to debug it to check that it operates smoothly and without interruption.

    Running your test on a new version of your application
    You run a test to check the behavīor of your application. While running, QuickTest connects to your application and performs each step in your test.

    Analyzing the test results
    You examine the test results to pinpoint defects in your application.

    Reporting defects
    As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.

     
    7) Explain the QTP Tool interface.

    A) It contains the following key elements:
    Title bar, displaying the name of the currently open test
    Menu bar, displaying menus of QuickTest commands
    File toolbar, containing buttons to assist you in managing tests
    Test toolbar, containing buttons used while creating and maintaining tests
    Debug toolbar, containing buttons used while debugging tests.

    Note: The Debug toolbar is not displayed when you open QuickTest for the first time. You can display the Debug toolbar by choosing View > Toolbars > Debug. Note that this tutorial does not describe how to debug a test. For additional information, refer to the QuickTest Professional User's Guide.

    Action toolbar, containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow.

    Note: The Action toolbar is not displayed when you open QuickTest for the first time. You can display the Action toolbar by choosing View > Toolbars > Action. If you insert a reusable or external action in a test, the Action toolbar is displayed automatically. For additional information, refer to the QuickTest Professional User's Guide.

    Test pane, containing two tabs to view your test-the Tree View and the Expert View
    Test Details pane, containing the Active Screen
    Data Table, containing two tabs, Global and Action, to assist you in parameterizing your test
    Debug Viewer pane, containing three tabs to assist you in debugging your test-Watch Expressions, Variables, and Command. (The Debug Viewer pane can be opened only when a test run pauses at a breakpoint.)
    Status bar, displaying the status of the test 
     

    8) How QTP recognizes Objects in AUT?
     A) QuickTest stores the definitions for application objects in a file called the Object Repository.  As you record your test, QuickTest will add an entry for each item you interact with.  Each Object Repository entry will be identified by a logical name (determined automatically by QuickTest), and will contain a set of properties (type, name, etc) that uniquely identify each object. 

    Each line in the QuickTest scrīpt will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method).  The references to objects in the scrīpt will all be identified by the logical name, rather than any physical, descrīptive properties.

    9) What are the types of Object Repositorys in QTP?

    A) QuickTest has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test.

    The object repository per-action mode is the default setting. In this mode, QuickTest automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object's property values in one action, you may need to make the same change in every action (and any test) containing the object.

    10) Explain the check points in QTP?

    A) . A checkpoint verifies that expected information is displayed in a Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP.

    A page checkpoint checks the characteristics of a Application
    A text checkpoint checks that a text string is displayed in the appropriate place on a Application.
    An object checkpoint (Standard) checks the values of an object on a Application.
    An image checkpoint checks the values of an image on a Application.
    A table checkpoint checks information within a table on a Application
    An Accessiblity checkpoint checks the web page for Section 508 compliance.
    An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application.
    A database checkpoint checks the contents of databases accessed by your web site
     

    11)In how many ways we can add check points to an application using QTP.
    A) We can add checkpoints while recording the application or we can add after recording is completed using Active screen (Note : To perform the second one The Active screen must be enabled while recording).

    12)How does QTP identifes the object in the application
    A) QTP identifies the object in the application by LogicalName and Class.

    For example :
    The Edit box is identified by
    Logical Name : PSOPTIONS_BSE_TIME20
    Class: WebEdit

    13)If an application name is changes frequently i.e while recording it has name “Window1” and then while running its “Windows2” in this case how does QTP handles?
    A)QTP handles those situations using “Regular Expressions”.

    14)What is Parameterizing Tests?
    A)When you test your application, you may want to check how it performs the same operations with multiple sets of data. For example, suppose you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data. Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data.

    15)What is test object model in QTP ?
     A) The test object model is a large set of object types or classes that QuickTest
    uses to represent the objects in your application. Each test object class has a
    list of properties that can uniquely identify objects of that class and a set of
    relevant methods that QuickTest can record for it.
    A test object is an object that QuickTest creates in the test or component to
    represent the actual object in your application. QuickTest stores information
    about the object that will help it identify and check the object during the
    run session.
    A run-time object is the actual object in your Web site or application on
    which methods are performed during the run session.
    When you perform an operation on your application while recording,

    QuickTest:
    ? identifies the QuickTest test object class that represents the object on which
    you performed the operation and creates the appropriate test object
    ? reads the current value of the object’s properties in your application and
    stores the list of properties and values with the test object
    ? chooses a unique name for the object, generally using the value of one of its
    prominent properties
    ? records the operation that you performed on the object using the
    appropriate QuickTest test object method

    For example, suppose you click on a Find button with the following HTML

    source code:
    <INPUT TYPE="submit" NAME="Find" VALUE="Find">
    QuickTest identifies the object that you clicked as a WebButton test object.
    It creates a WebButton object with the name Find, and records the following
    properties and values for the Find WebButton:
    It also records that you performed a Click method on the WebButton.
    QuickTest displays your step in the Keyword View like this:
    QuickTest displays your step in the Expert View like this:
    Browser("Mercury Interactive").Page("Mercury Interactive").
    WebButton("Find").Click
     

    16)    What is Object Spy in QTP?

    A) Using the Object Spy, you can view the properties of any object in an open
    application. You use the Object Spy pointer to point to an object. The Object
    Spy displays the selected object’s hierarchy tree and its properties and values
    in the Properties tab of the Object Spy dialog box.

     
    17. Supported Check-Points in QTP?
    17)    What is the Diff between Image check-point and Bit map Check point?
    A) Image checkpoints enable you to check the properties of a Web image.
    You can check an area of a Web page or application as a bitmap. While
    creating a test or component, you specify the area you want to check by
    selecting an object. You can check an entire object or any area within an
    object. QuickTest captures the specified object as a bitmap, and inserts a
    checkpoint in the test or component. You can also choose to save only the
    selected area of the object with your test or component in order to save disk Space
    For example, suppose you have a Web site that can display a map of a city
    the user specifies. The map has control keys for zooming. You can record the
    new map that is displayed after one click on the control key that zooms in
    the map. Using the bitmap checkpoint, you can check that the map zooms
    in correctly.

    You can create bitmap checkpoints for all supported testing environments
    (as long as the appropriate add-ins are loaded).
    Note: The results of bitmap checkpoints may be affected by factors such as
    operating system, screen resolution, and color settings.
     
    18)    How many ways we can parameterize data in QTP ?
    A) There are four types of parameters:
    Test, action or component parameters enable you to use values passed
    from your test or component, or values from other actions in your test.

    Data Table parameters enable you to create a data-driven test (or action)
    that runs several times using the data you supply. In each repetition, or
    iteration, QuickTest uses a different value from the Data Table.

    Environment variable parameters enable you to use variable values from
    other sources during the run session. These may be values you supply, or
    values that QuickTest generates for you based on conditions and options
    you choose.
     
    Random number parameters enable you to insert random numbers as
    values in your test or component. For example, to check how your
    <SPAN style="FONT-SIZE: 10pt; FONT-FAMIL

     

    1. What are the Features & Benefits of Quick Test Pro (QTP 8.0)? - Operates stand-alone, or integrated into Mercury Business Process Testing and Mercury Quality Center. Introduces next-generation zero-configuration Keyword Driven testing technology in Quick Test Professional 8.0 allowing for fast test creation, easier maintenance, and more powerful data-driving capability. Identifies objects with Unique Smart Object Recognition, even if they change from build to build, enabling reliable unattended scrīpt execution. Collapses test documentation and test creation to a single step with Auto-documentation technology. Enables thorough validation of applications through a full complement of checkpoints.
    2. How to handle the exceptions using recovery scenario manager in QTP? - There are 4 trigger events during which a recovery scenario should be activated. A pop up window appears in an opened application during the test run: A property of an object changes its state or value, A step in the test does not run successfully, An open application fails during the test run, These triggers are considered as exceptions.You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps: 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run

    3. What is the use of Text output value in QTP? - Output values enable to view the values that the application talks during run time. When parameterized, the values change for each iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table.
    4. How to use the Object spy in QTP 8.0 version? - There are two ways to Spy the objects in QTP: 1) Thru file toolbar, In the File Toolbar click on the last toolbar button (an icon showing a person with hat). 2) True Object repository Dialog, In Object repository dialog click on the button object spy. In the Object spy Dialog click on the button showing hand symbol. The pointer now changes in to a hand symbol and we have to point out the object to spy the state of the object if at all the object is not visible. or window is minimized then, hold the Ctrl button and activate the required window to and release the Ctrl button.
    5. How Does Run time data (Parameterization) is handled in QTP? - You can then enter test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files.
    6. What is keyword view and Expert view in QTP? - Quick Test’s Keyword Driven approach, test automation experts have full access to the underlying test and object properties, via an integrated scrīpting and debugging environment that is round-trip synchronized with the Keyword View. Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBscrīpt that Quick Test Professional automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.
    7. Explain about the Test Fusion Report of QTP? - Once a tester has run a test, a Test Fusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining Test Fusion reports with Quick Test Professional, you can share reports across an entire QA and development team.
    8. Which environments does QTP support? - Quick Test Professional supports functional testing of all enterprise environments, including Windows, Web,..NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services.
    9. What is QTP? - Quick Test is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, Quick Test Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and.NET framework applications
    10. Explain QTP Testing process? - Quick Test testing process consists of 6 main phases:
    11. Create your test plan - Prior to automating there should be a detailed descrīption of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application.
    12. Recording a session on your application - As you navigate through your application, Quick Test graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.
    13. Enhancing your test - Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly. NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process. Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data. Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.
    14. Debugging your test - If changes were made to the scrīpt, you need to debug it to check that it operates smoothly and without interruption.
    15. Running your test on a new version of your application - You run a test to check the behavīor of your application. While running, Quick Test connects to your application and performs each step in your test.
    16. Analyzing the test results - You examine the test results to pinpoint defects in your application.
    17. Reporting defects - As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.
    18. Explain the QTP Tool interface. - It contains the following key elements: Title bar, displaying the name of the currently open test, Menu bar, displaying menus of Quick Test commands, File toolbar, containing buttons to assist you in managing tests, Test toolbar, containing buttons used while creating and maintaining tests, Debug toolbar, containing buttons used while debugging tests. Note: The Debug toolbar is not displayed when you open Quick Test for the first time. You can display the Debug toolbar by choosing View — Toolbars — Debug. Action toolbar, containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow. Note: The Action toolbar is not displayed when you open Quick Test for the first time. You can display the Action toolbar by choosing View — Toolbars — Action. If you insert a reusable or external action in a test, the Action toolbar is displayed automatically. Test pane, containing two tabs to view your test-the Tree View and the Expert View ,Test Details pane, containing the Active Screen. Data Table, containing two tabs, Global and Action, to assist you in parameterizing your test. Debug Viewer pane, containing three tabs to assist you in debugging your test-Watch Expressions, Variables, and Command. (The Debug Viewer pane can be opened only when a test run pauses at a breakpoint.) Status bar, displaying the status of the test
    19. How does QTP recognize Objects in AUT? - Quick Test stores the definitions for application objects in a file called the Object Repository. As you record your test, Quick Test will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name (determined automatically by Quick Test), and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the Quick Test scrīpt will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method). The references to objects in the scrīpt will all be identified by the logical name, rather than any physical, descrīptive properties.
    20. What are the types of Object Repositories in QTP? - Quick Test has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test. The object repository per-action mode is the default setting. In this mode, Quick Test automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object’s property values in one action, you may need to make the same change in every action (and any test) containing the object.
    21. Explain the check points in QTP? - A checkpoint verifies that expected information is displayed in an Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP. A page checkpoint checks the characteristics of an Application. A text checkpoint checks that a text string is displayed in the appropriate place on an Application. An object checkpoint (Standard) checks the values of an object on an Application. An image checkpoint checks the values of an image on an Application. A table checkpoint checks information within a table on a Application. An Accessibilityy checkpoint checks the web page for Section 508 compliance. An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application. A database checkpoint checks the contents of databases accessed by your web site
    22. In how many ways we can add check points to an application using QTP? - We can add checkpoints while recording the application or we can add after recording is completed using Active screen (Note : To perform the second one The Active screen must be enabled while recording).
    23. How does QTP identify objects in the application? - QTP identifies the object in the application by Logical Name and Class.
    24. What is Parameterizing Tests? - When you test your application, you may want to check how it performs the same operations with multiple sets of data. For example, suppose you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data. Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data.
    25. What is test object model in QTP? - The test object model is a large set of object types or classes that Quick Test uses to represent the objects in your application. Each test object class has a list of properties that can uniquely identify objects of that class and a set of relevant methods that Quick Test can record for it. A test object is an object that Quick Test creates in the test or component to represent the actual object in your application. Quick Test stores information about the object that will help it identify and check the object during the run session.
    26. What is Object Spy in QTP? - Using the Object Spy, you can view the properties of any object in an open application. You use the Object Spy pointer to point to an object. The Object Spy displays the selected object’s hierarchy tree and its properties and values in the Properties tab of the Object Spy dialog box.
    27. What is the Diff between Image check-point and Bit map Check point? - Image checkpoints enable you to check the properties of a Web image. You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. Quick Test captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk Space. For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly. You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins are loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.
    28. How many ways we can parameterize data in QTP? - There are four types of parameters: Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test. Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, Quick Test uses a different value from the Data Table. Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply, or values that Quick Test generates for you based on conditions and options you choose. Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application handles small and large ticket orders, you can have Quick Test generate a random number and insert it in a number of tickets edit field.
    29. How do u do batch testing in WR & is it possible to do in QTP, if so explain? - Batch Testing in WR is nothing but running the whole test set by selecting Run Test set from the Execution Grid. The same is possible with QTP also. If our test cases are automated then by selecting Run Test set all the test scrīpts can be executed. In this process the scrīpts get executed one by one by keeping all the remaining scrīpts in Waiting mode.
    30. If I give some thousand tests to execute in 2 days what do u do? - Adhoc testing is done. It Covers the least basic functionalities to verify that the system is working fine.
    31. What does it mean when a check point is in red color? what do u do? - A red color indicates failure. Here we analyze the cause for failure whether it is a scrīpt Issue or Environment Issue or a Application issue.
    32. What is Object Spy in QTP? - Using the Object Spy, you can view the properties of any object in an open application. You use the Object Spy pointer to point to an object. The Object Spy displays the selected object’s hierarchy tree and its properties and values in the Properties tab of the Object Spy dialog box.
    33. What is the file extension of the code file & object repository file in QTP? - Code file extension is.vbs and object repository is.tsr
    34. Explain the concept of object repository & how QTP recognizes objects? - Object Repository: displays a tree of all objects in the current component or in the current action or entire test (depending on the object repository mode you selected). We can view or modify the test object descrīption of any test object in the repository or to add new objects to the repository. Quicktest learns the default property values and determines in which test object class it fits. If it is not enough it adds assistive properties, one by one to the descrīption until it has compiled the unique descrīption. If no assistive properties are available, then it adds a special Ordinal identifier such as objects location on the page or in the source code.
    35. What are the properties you would use for identifying a browser & page when using descrīptive programming? - Name would be another property apart from title that we can use.
    36. Give me an example where you have used a COM interface in your QTP project? - com interface appears in the scenario of front end and back end. for eg:if you r using oracle as back end and front end as VB or any language then for better compatibility we will go for an interface. of which COM will be one among those interfaces. Create object creates handle to the instance of the specified object so that we program can use the methods on the specified object. It is used for implementing Automation(as defined by Microsoft).
    37. Explain in brief about the QTP Automation Object Model. - Essentially all configuration and run functionality provided via the Quick Test interface is in some way represented in the Quick Test automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in Quick Test have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the Quick Test automation object model, along with standard programming elements such as loops and conditional statements to design your program.


  • fundamental difference between Quality Assurance and Quality Control

    2007-05-29 14:47:15

    Definitions:

    Quality Assurance (QA) Consists of planning, coordinating and other
    strategic activities associated with measuring product quality against
    external requirements and specifications (process-related activities).


    Quality Control (QC) Consists of monitoring, controlling and other
    tactical activities associated with the measurement of product quality goals.




    The following statements help differentiate Quality Control from Quality Assurance:

  • Quality Control is related to a specific product or service
  • Quality Control verifies whether specific attribute are in, or are not in, a specific product or service
  • Quality Control identifies defects for the primary purpose of correcting defects
  • Quality Control is the responsibility of the team/worker
  • Quality Control is concerned with a specific product.
  • Quality Control (QC) – Is a part of the Quality Assurance procedures
  • Quality control is a technical function.
  • Quality control (QC) is corrective process.
  • Quality Assurance helps establish processes
  • Quality Assurance sets up measurement programs to evaluate processes
  • Quality Assurance identifies weaknesses in processes and improves them
  • Quality Assurance is a management responsibility, frequently performed by a staff function
  • Quality Assurance is concerned with all of the products that will ever be produced by a process
  • Quality Assurance personnel should not ever perform Quality Control unless it is to validate Quality Control
  • Quality assurance is a system of management activities.
  • Quality assurance  (QA) is preventive process.
  • Quality assurance  (QA) applies to the entire life cycle
  • QA is process oriented and QC is product oriented
  • A quality system provides the framework for developing quality assurance policy
  • [转]General interview questions QA for Software testers and QA professionals

    2007-05-29 12:24:22

    1. What types of documents would you need for QA, QC, and Software Testing?
    2. What did you include in a test plan?
    3. Describe any bug you remember.
    4. What is the purpose of the software testing?
    5. What do you like (not like) in this job?
    6. What is QA (quality assurance)?
    7. What is the difference between QA and software testing?    Read the answer for this
    interview question   for software testers
    8. How do you scope, organize, and execute a test project?
    9. What is the role of QA in a development project?
    10. What is the role of QA in a company that produces software?
    11. Define quality for me as you understand it
    12. Describe to me the difference between validation and verification.
    13. Describe to me what you see as a process. Not a particular process, just the basics of having a process.
    14. Describe to me when you would consider employing a failure mode and effect analysis.
    15. Describe to me the Software Development Life Cycle as you would define it.
    16. What are the properties of a good requirement?
    17. How do you differentiate the roles of Quality Assurance Manager and Project Manager?
    18. Tell me about any quality efforts you have overseen or implemented. Describe some of the challenges you faced and how you overcame them.
    19. How do you deal with environments that are hostile to quality change efforts?
    20. In general, how do you see automation fitting into the overall process of testing?
    21. How do you promote the concept of phase containment and defect prevention?
    22. If you come onboard, give me a general idea of what your first overall tasks will be as far as starting a quality effort.
    23. What kinds of software testing have you done?
    24. Have you ever created a test plan?
    25. Have you ever written test cases or did you just execute those written by others?
    26. What did your base your test cases?
    27. How do you determine what to test?
    28. How do you decide when you have 'tested enough?'
    29. How do you test if you have minimal or no documentation about the product?
    30. Describe me to the basic elements you put in a defect report?
    31. How do you perform regression testing of software?
    32. At what stage of the life cycle does testing begin in your opinion?
    33. How do you analyze your test results? What metrics do you try to provide?
    34. Realising you won't be able to test everything - how do you decide what to test first?
    35. Where do you get your expected results?
    36. If automating - what is your process for determining what to automate and in what order?
    37. In the past, I have been asked to verbally start mapping out a test plan for a common situation, such as an ATM. The interviewer might say, "Just thinking out loud, if you were tasked to test an ATM, what items might you test plan include?" These type questions are not meant to be answered conclusively, but it is a good way for the interviewer to see how you approach the task.
    38. If you're given a program that will average student grades, what kinds of inputs would you use?
    39. Tell me about the best bug you ever found.
    40. What made you pick software testing over another career?
    41. What is the exact difference between Integration & System testing, give me examples with your project.
    42. How did you go about software testing a project?
    43. When should software testing start in a project? Why?
    44. How do you go about testing a web application?
    45. Difference between Black & White box software testing
    46. What is Configuration management? Tools used?
    47. What do you plan to become after say 2-5yrs (Ex: QA Manager, Why?)
    48. Would you like to work in a team or alone, why?
    49. Give me 5 strong & weak points of yours
    50. Why do you want to join our company?
    51. When should software testing be stopped?
    52. What sort of things would you put down in a bug report?
    53. Who in the company is responsible for Quality?
    54. Who defines quality?
    55. What is an equivalence class?
    56. Is a "A fast database retrieval rate" a testable requirement?
    57. Should we test every possible combination/scenario for a program?
    58. What criteria do you use when determining when to automate a test or leave it manual?
    59. When do you start developing your automation tests?
    60. Discuss what test metrics you feel are important to publish an organization?
    61. In case anybody cares, here are the questions that I will be asking:
    62. Describe the role that QA plays in the software lifecycle.
    63. What should Development require of QA?
    64. What should QA require of Development?
    65. How would you define a "bug?"
    66. Give me an example of the best and worst experiences you've had with QA.
    67. How does unit testing play a role in the development / software lifecycle?
    68. Explain some techniques for developing software components with respect to testability.
    69. Describe a past experience with implementing a test harness in the development of software.
    70. Have you ever worked with QA in developing test tools? Explain the participation Development should have with QA in leveraging such test tools for QA use.
    71. Give me some examples of how you have participated in Integration Testing.
    72. How would you describe the involvement you have had with the bug-fix cycle between Development and QA?
    72. What is unit testing?
    73. Describe your personal software development process.
    74. How do you know when your code has met specifications?
    75. How do you know your code has met specifications when there are no specifications?
    76. Describe your experiences with code analyzers.
    77. How do you feel about cyclomatic complexity?
    78. Who should test your code?
    79.How do you survive chaos?
    80. What processes/methodologies are you familiar with?
    81. What type of documents would you need for QA/QC/Software Testing?
    82. How can you use technology to solve problem?
    83. What type of metrics would you use?
    84. How to find that tools work well with your existing system?
    85. What automated tools are you familiar with?
    86. How well you work with a team?
    87. How would you ensure 100% coverage during software testing?
    88. How would you build a test team?
    89. What problem you have right now or in the past? How you solved it?
    90. What you will do during the first day of job?
    91. What would you like to do five years from now?
    92. Tell me about the worst boss you've ever had.
    93. What are your greatest weaknesses?
    94. What are your strengths?

    95. What is a successful product?
    96. What do you like about Windows?
    97. What is good code?
    98. Who is Kent Beck, Dr Grace Hopper, Dennis Ritchie?
    99. What are basic, core, practises for a QA specialist?
    100. What do you like about QA?
    101. What has not worked well in your previous QA experience and what would you change?
    102. How you will begin to improve the QA process?
    103. What is the difference between QA and QC?
    104. What is UML and how to use it for software testing?
    105. What is CMM and CMMI? What is the difference?
    106. What do you like about computers?
    107. Do you have a favourite QA book? More than one? Which ones? And why.
    108. What is the responsibility of programmers vs QA?
    109.What are the properties of a good requirement?
    110.How to do test if we have minimal or no documentation about the product?
    111.What are all the basic elements in a defect report?
    112.Is an "A fast database retrieval rate" a testable requirement?
    113.Why should you care about objects and object-oriented testing?
    114. What does 100% statement coverage mean?
    115. How do you perform configuration management with typical revision control systems?
    116. What is code coverage?
    117. What types of code coverage do you know?
    118. What tools can be used for code coverage analysis?
    119. Is any graph is used for code coverage analysis?
    120. At what stage of the development cycle software errors are least costly to correct?
    121. What can you tell about the project if during testing you found 80 bugs in it?
    122. How to monitor test progress?
    123. Describe a few reasons that a bug might not be fixed.
    124. What are the possible states of software bug锟絪 life cycle?
    125. What books about QA (software testing) did you read?
    126. What type of testing based specifically on a program code?
    127. What type of testing based on any document that describes the "structure of the software"?
    128. Please describe test design techniques like: state-transition diagrams, decision tables, activity diagrams.
    129. Describe business process testing and what test design technique would you use for it?
  • 收集的一些简单的WEB相关问题

    2007-05-29 11:21:49

    1. Question: What are possible configurations that could affect the testing strategy of any web site?
            Answer: Hardware platform (PC, Mac), Browser software and version, Browser Plug-Ins, Browser settings options, Video resolution and Colour Depth, text size

    2. Question: What the latest web technologies do you know?  
            Answer:   RSS(注:既可以是“Rich Site Summary”,或“RDF Site Summary”,也可以是“Really Simple Syndication”。)

    3.  Question: What types of web testing security problems do you know?
             Answer:(Denial of Service (DoS) attack, buffer overflow)

    4. Question: What types HTTP Response Codes do you know?
            Answer: ( 2xx - success,  3xx - Redirection, 4xx - Client Error, 5xx - Server Error )

    6. Difference between HTTP and HTTPS? Explain how the data is secured in HTTPS?

  • 收集的一些简单的SQL面试题

    2007-05-29 10:56:50

    1. Q. What is a join?
       A. Join is a process of retrieve pieces of data from different sets (tables) and returns them to the user or program as one joined collection of data.

    2. Q. Can a table have more than one foreign key defined?
       A. A table can have any number of foreign keys defined. It can have only
           one primary key defined.

    3. Q. List all the possible values that can be stored in a BOOLEAN data field.
       A. There are only two values that can be stored in a BOOLEAN data field:
             -1(true) and 0(false).
    4.  Q. What is a stored procedure?
        A. A procedure is a group of PL/SQL statements that can be called by
            a name. Procedures do not return values they perform tasks.

    5.  Q. What is Normalization?
        A. The process of table design is called normalization.

    6.  Q. Write a SQL SELECT sample of the concatenation operator.
        A.  SELECT LastName ||',' || FirstName, City FROM Students;

    7. Q. Is the WHERE clause must appear always before the GROUP BY clause in SQL SELECT ?

        A. Yes.
    The proper order for SQL SELECT
    clauses is: SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY.
    Only the SELECT and FROM clause are mandatory.

    8. Q. Which operator do you use to return all of the rows
    from one query except rows are returned in a second query?

        A. You use the MINUS operator to return all rows from one query except
    where duplicate rows are found in a second query. The UNION operator
    returns all rows from both queries minus duplicates. The UNION ALL operator
    returns all rows from both queries including duplicates.
    The INTERSECT operator returns only those rows that exist in both queries.

    9. Q. Which of the following statements are Data Manipulation Language commands?
    A. INSERT
    B. UPDATE
    C. GRANT
    D. TRUNCATE
    E. CREATE

        A.  A and B � The INSERT and UPDATE statements are
    Data Manipulation Language (DML) commands.
    GRANT is a Data Control Language (DCL) command.
    TRUNCATE and CREATE are Data Definition Language (DDL) commands

    10.   Q.  Describe some Group Functions that you know
    A. 1) The COUNT function tells you how many rows were in the result set.
          SELECT COUNT(*) FROM TESTING.QA
        2) The AVG function tells you the average value of a numeric column.
           SELECT MAX(SALARY) FROM TESTING.QA
        3) The MAX and MIN functions tell you the maximum and minimum value of a numeric column.
           SELECT MIN(SALARY) FROM TESTING.QA 
         4) The SUM function tells you the sum value of a numeric column.
            SELECT SUM(SALARY) FROM TESTING.QA

  • 收集的一些简单的UNIX/Linux面试题

    2007-05-28 22:00:24

    UNIX问题:
    1. Q. How do you find out the processes that are currently running or a particular user?
       A. ps -au Myname   (-u by effective user ID (supports names)) (a - all users)

    2. Q. How do you kill a process?
       A. kill -9  8 (process_id 8) or kill -9  %7  (job number 7)
          kill -9 -1  (Kill all processes you can kill.)
          killall - kill processes by name most (useful - killall java)


    3. Q. What would you use to view contents of a large error log file?
       A. tail  -10 file_name   ( last 10 rows)


    4.Q. How do you list contents of a directory including all of its
      subdirectories, providing full details and sorted by modification time?
       A. ls -lac
          -a all entries
          -c by time


    5.Q. How do you create a symbolic link to a file (give some reasons of doing so)?
       A. ln /../file1 Link_name
    Hard Link, soft Link?

    6.Q. How do you check the sizes of all users锟?home directories (one command)?
       A. du -s
          df

    7.Q. How do you check for processes started by user 'pat'?

       A. ps -fu pat   (-f -full_format u -user_name )

    8.Q. How do you start a job on background?

       A. bg  %4  (job 4)

    9. Q. How to remove directory with files?
        A. rm -rf directory_name

    10. Q. How can you see all mounted drives?
        A. mount -l

    11. Q. How can you find a path to the file in the system?
        A. locate file_name (locate - list files in databases that match a pattern)

    12. Q. What Linux  HotKeys do you know?
        A. Ctrl-Alt-F1 Exit to command prompt
           Ctrl-Alt-F7 or F8    Takes you back to KDE desktop from command prompt
           Crtl-Alt-Backspace Restart XWindows
           Ctrl-Alt-D Show desktop

    13. Q. If you would like to run two commands in sequence what operators you can use?

         A. ; or && the difference is:
    if you separate commands with ; second command will be run automatically.
    if you separate commands with && second command will be run only in the case
     the first was run successfully.

    14.  Question: How to switch to a previously used directory?
         Answer:   cd -

  • 关于SQL Injection

    2007-05-28 11:51:17

        关于sql injection, 今天看了个大概,有空再仔细研究。

    http://msdn2.microsoft.com/zh-cn/library/ms161953.aspx

  • [转]控制台速成班

    2007-05-27 22:28:35

    转:Linux 控制台具有强大而灵活的功能。如果过了相当一段时间您还要用很多时间去查看命令的提示,那么您应该花费一些时间复习一下那些您将不断用到的常见命令,来更好地熟悉这个环境。
           本部分将介绍各种不同的 shell 和一些最基本的 Linux 命令。Linux 中的所有管理任务都可以在控制台中完成。许多情况下,使用控制台比使用图形化的程序更快捷,而且还可能实现额外的功能。不仅如此,所有的控制台任务都可以写到脚本中,这样就可以自动执行。为了真正地驾驭您的 Linux 环境,您将希望掌握如何在控制台中工作。如果您曾经使用过 DOS/Windows,本文将引导您开始使用 Linux 控制台。
    进入控制台

    如果您的系统引导进入文本模式(为了降低服务开销,服务器通常是这样配置的),那么您在以文本形式登录后就已经在控制台中了。在典型的 Linux 系统中,通过组合键 Ctrl + Alt + (F1 - F6) 您可以切换到另外的控制台。每一个控制台是系统中一个完全独立的会话,不同的用户可以同时使用。

    这一多控制台的特点与 Windows 中的多桌面不同。在 Linux 中,每一个控制台可以分别由完全不同的用户来控制。例如,您可能在控制台 1 中以 root 身份登录,而在控制台 2 中以 joeuser 身份登录。两个控制台在各自的用户空间中运行不同的程序。与此类似,不同的用户可以远程登录到同一个 Windows 系统中。就这一点来说,Linux 更像是主机而不是简单的服务器或工作站。

    如果您是在图形模式下,那么您可以打开一个 终端 (terminal) 以进入控制台窗口。通常在桌面的任务条上会有终端的按钮。您也可以从上下文菜单(在桌面上单击右键)打开终端 。

    命令 在控制台中可以使用的命令很多。其中有一些实际上只在编写脚本时才会用到。这里介绍一些您最可能用到的命令。不要忘记,所有的命令和选项都区分大小写。-R 与 -r 不同,会去执行不同的操作。控制台命令几乎全都是小写的。

    cd 使用我们所熟悉的 cd 命令可以在目录间切换。一定注意的是在 Linux 中用的是正斜杠 (/),而不是您所熟悉的反斜杠 (\)。反斜杠也用到了,但只是用来说明命令需要换行继续,这样可以提高比较长的命令的可读性。

    ls 命令用于列出一个目录下的所有文件。可以使用许多不同的开关更改列表的表示形式:

    列出文件

    cp 使用 cp 命令来复制文件。这个命令与 DOS 下的 copy 命令基本一样。基本的开关如下:

    复制文件

    使用复制命令创建链接

    用 cp 命令可以创建指向一个文件或者整个文件结构的硬链接。使用 -l 开关来指明操作是链接复制。所有的目录仍作为目录创建,但所有的文件会被设置为硬链接。

    cp -lR /data/accounting/payroll /data/management/hr



    上面的命令将把整个目录结构及其下面的文件从 /data/accounting/payroll 复制到 /data/management/hr/payroll。目录结构下的所有文件将被设置为硬链接。这样使一个文件在同一个文件系统中可以具备不同的视图。这也是有用的安全技术,使得在不同的目录下对同一文件有不同的访问权限。

    mv 使用 mv 命令来移动和重命名文件。这个命令的工作方式基本上与 DOS 中的 move 命令一样,不过它可以移动整个目录结构及所有文件。

    cat 使用 cat 命令来查看文件的内容。它相当于 DOS 中的 type 命令。它将把文件的内容转储到另一个文件、屏幕或者其他命令。cat 是concatenate 的简写,还可以将一系列的文件合并为一个大文件。

    more 使用命令 more 可以以分页的方式查看文件。它基本上与 DOS 中的 more 命令相同。

    less 命令也是用来查看文件,但是它支持上下滚屏以及在文档中进行文本搜索。

    vi 有一些人可能会说 vi 表示“virtually impossible”。它是 Unix 中的一个历史悠久的文本编辑器。vi 并不真正直观,但是现在几乎所有的类 Unix 环境中都有 vi。对于 Linux 中安装的版本有一个内置的教程,一旦您熟悉了 vi,只需几次击键就可以完成不可思议的任务。说实话,没有任何编辑器能够取代 vi 来编辑密码和配置文件。

    man 使用 man 命令来查看命令的文档。man 是 manual 的缩写。几乎每一个命令都有相应的文档。要深入了解 man,请输入以下命令:

    man man



    info info 命令与 man 命令类似,不过它提供了超链接文本,可以更方便地浏览文档。

    哪个 shell?

    DOS/Windows 与 Linux 的最重要的区别之一是 Linux 的命令 shell 是与操作系统相分离的一层。不同的 shell 环境影响您具备不同的功能,比如可编辑的命令行和历史命令回查等。shell 还决定了脚本中函数的语法。在 DOS/Windows 中,编写脚本程序只有一种情况,那就是使用效率低下的 .BAT 文件。它的确可以完成很多功能,但除了完成那些基本的任务,复杂些的任务就需要脚本编写者具有极强的创造性。在 Linux 中,脚本中可以有循环,不仅可以执行基本的条件语句,很多在编程语言中才有的功能它都具备。如果您擅长编写 .BAT 文件,那么 shell 脚本更会使您大展才华。

    默认的 shell 是每个用户帐号的一个参数。Linux 中典型的默认 shell 是 /bin/bash,不过也可以用其他的 shell。每个 shell 的 man 文档实际上都非常好,都对各种 shell 及其使用进行了详细的说明。仅仅阅读下面的解释是不够的,应该从下面列出的 shell 中选择一个,去查看它的 man 文档。

    bash bash shell 是 Bourne shell 的一个免费版本,它是最早的 Unix shell,包括许多附加的特点。Bash 有可编辑的命令行,可以回查历史命令,支持 tab 键补齐以使用户避免输入长的文件名。

    csh C shell 使用的是“类C”语法,借鉴了 Bourne shell 的许多特点,只是内部 shell 命令集有所不同。

    ksh Korn shell 的语法与 Bourne shell 相同,同时具备了 C shell 的易用特点。许多安装脚本都使用 ksh,即使您不把它作为您的主 shell,您也应该在系统中安装它。

    tcsh TC shell 是 C shell 的一个增强版本,与 C shell 完全兼容。

    zsh Z shell 是 Korn shell 的一个增强版本,具备 bash shell 的许多特色。

    Shell 规则

    您只需在控制台中执行相应的命令就可以随时切换 shell。只要在文件顶部放置一个井号 (#!) 指向需要的 shell,脚本就可以指定想要运行的 shell。当脚本运行的时候,不管用户所处的 shell 环境是什么,它都会在正确的 shell 环境中运行。下面例子中的这行代码指出脚本需要在 C shell 下运行:

    #!/bin/csh



    给我做链接,这样就更安全!

    Linux 文件系统最重要的特点之一是它的文件链接。链接是对文件的引用,这样您可以让文件在文件系统中多处被看到。不过,在 Linux 中,链接可以如同原始文件一样来对待。链接可以与普通的文件一样被执行、编辑和访问。对系统中的其他应用程序而言,链接就是它所对应的原始文件。当您通过链接对文件进行编辑时,您编辑的实际上是原始文件。链接不是副本。有两种类型的链接:硬链接和符号链接。

    硬链接 只能引用同一文件系统中的文件。它引用的是文件在文件系统中的物理索引(也称为 inode)。当您移动或删除原始文件时,硬链接不会被破坏,因为它所引用的是文件的物理数据而不是文件在文件结构中的位置。硬链接的文件不需要用户有访问原始文件的权限,也不会显示原始文件的位置,这样有助于文件的安全。如果您删除的文件有相应的硬链接,那么这个文件依然会保留,直到所有对它的引用都被删除。

    符号链接 是一个指针,指向文件在文件系统中的位置。符号链接可以跨文件系统,甚至可以指向远程文件系统中的文件。符号链接只是指明了原始文件的位置,用户需要对原始文件的位置有访问权限才可以使用链接。如果原始文件被删除,所有指向它的符号链接也就都被破坏了。它们会指向文件系统中并不存在的一个位置。两种链接都可以通过命令 ln 来创建。ln 默认创建的是硬链接。使用 -s 开关可以创建符号链接。

    # Create a hard link from MyFile in the current
    # directory to /YourDir/MyFile
    ln MyFile /YourDir

    # Create a symbolic (soft) link from MyFile in
    # the current directory to /YourDir/YourFile
    ln -s MyFile /YourDir/Yourfile



    在上面的例子中,MyFile、/YourDir/MyFile 和 /YourDir/Yourfile 会被看成是同一个文件。

    走出您的 shell

    对 Linux 管理来说,必须学习在控制台环境下工作。虽然有一些工具可以让您避免使用控制台,但是您会受到那些工具的很多限制。进入控制台很简单,使用 man 和 info 命令访问命令文档也很方便。
  • 评委和观众终于发狠了

    2007-05-27 21:23:16

        看到在宣布短信票数的时候张迪频频点头的样子,没有看过之前比赛的怪现象的观众或许是不会明白为何短信排名最后的他会有一种释怀甚至是欣喜的浅浅的笑容。三位评委终于下定决心捍卫自己心中最优秀的选手,很显然他们对宝玉组的任何一位选手都不会达到绝对的满意,9盏灯是出于一种“违心”,但这种“违心”是出于对他们真正欣赏的选手的保护。
        从昨天比赛的1万多票到今天的10万多票,张迪此时一定是深深的感受到了喜爱他的观众们为了留住他所作出的努力。我不是他的粉丝,对他只是欣赏,我寄予希望的是蒋晨阳,虽然他的普通话和演技都不过关;但今天张迪直接晋级还是给了我这个红楼迷一个宽慰。

    (P.S.不必质疑车缙的短信票数,人口本来就众多的四川省拥有全国最广大的选秀投票观众群,没有其他任何一个省的观众能有四川人那种投票的热情,所以那里诞生了李宇春、何洁、张靓影、谭维维这样的选秀明星。倒是王龙华的票数实在让人生疑,看给他的留言里,正面的留言都是连续由同一个IP发出的,可见真正喜欢他的人少之又少。)

  • 歪酷

    2007-05-27 19:49:40

        最近重拾心情开始经营博客,想起过去的歪酷,有的时候还会打开主页刷新一下看有哪些最新更新的博客。歪酷的用户群还是很庞大的,随便刷刷都有更新,只是我已经不再年轻,没有心力在那上面大把的抒怀青春~~
  • 693/4<1234>

    数据统计

    • 访问量: 52937
    • 日志数: 86
    • 建立时间: 2007-05-23
    • 更新时间: 2007-10-13

    RSS订阅

    Open Toolbar