1. Field of the Invention
The present invention relates to a system which executes a unit test for an application in an image forming apparatus capable of installing an application, an information processing apparatus and control method thereof, an image forming apparatus and control method thereof, and a computer-readable medium.
2. Description of the Related Art
Conventionally in an image forming apparatus and its control, an execution environment (for example, Java®) for another embedded system can be built on a real-time OS. Further, an application platform capable of externally downloading and adding an application for controlling an image forming apparatus has been mounted.
There is provided a development environment used when developing an application on the application platform. For example, Japanese Patent Laid-Open No. 2009-519544 discloses a mechanism of automatically performing build up to acquisition of a test result, storing the state of an application platform, and facilitating debugging.
To check the operation of a developed application, another test application is generated. The generated application calls the API (Application Program Interface) of the developed application and checks the operation. In this case, by using a function provided by the framework of a platform on which the application runs, the application to be tested needs to permit publication of an API in advance so that the API is called from another application (outside).
More specifically, a setting file in the application needs to make an export declaration for publication. The application which performs a test needs to be implemented so that it can use a publicized API. On the premise of an export declaration in a manifest file serving as the setting file of an API, the application needs to make an import declaration for the API. To check the operation of a developed application using two applications, both of the applications require implementations for executing a test.
The method of checking the operation of an application using a test application is effective for debugging during application development. However, commercially available applications are configured so that an API is not called from the outside in terms of security. As for an API which does not require an export declaration, no export declaration is made in the manifest file. Hence, this method cannot be used as a method of, when a problem occurs in the market (environment of a user who purchased the application), checking the operation of the application in the user environment.
Also, when an export declaration is temporarily made in the manifest file for debugging in application development, the developer may forget to return the change to an original state. In this case, the application can be called from the outside. If the application in this state comes onto the market, a malicious user may attack the application. This poses a security problem.
According to one aspect of the present invention, there is provided a system comprising an image forming apparatus capable of installing and executing a provided application, and an information processing apparatus which provides a development environment for the application to be executed by the image forming apparatus, the information processing apparatus including: a generation unit configured to generate, upon receiving an instruction to generate an application to be executed in the image forming apparatus, an application containing an application program for implementing a function of the application, a test program for testing a function provided by the application, and a test agent program for issuing a command to start execution of the test program in accordance with an instruction from the information processing apparatus; a send unit configured to send the application generated by the generation unit to the image forming apparatus; and an instruction unit configured to issue, upon receiving an instruction to start the test program, an instruction via the test agent program to start execution of the test program contained in the application installed in the image forming apparatus, and the image forming apparatus including: an installation unit configured to install the application upon receiving an instruction to install the application generated by the generation unit; and a start unit configured to start execution of the test program in accordance with the command issued from the test agent program upon accepting the instruction from the instruction unit via the test agent program to start execution of the test program.
According to another aspect of the present invention, there is provided an image forming apparatus capable of installing and executing an externally provided application, comprising: a reception unit configured to receive an application containing an application program for implementing a function of the application, a test program for testing a function provided by the application, and a test agent program for issuing a command to start execution of the test program in accordance with an external instruction; an installation unit configured to install the received application; and a start unit configured to start execution of the test program in accordance with the command issued from the test agent program upon accepting the instruction via the test agent program to start execution of the test program.
According to another aspect of the present invention, there is provided an information processing apparatus which provides a development environment for an application to be executed by an image forming apparatus capable of adding and executing an externally provided application, comprising: a generation unit configured to generate, upon receiving an instruction to generate an application to be executed in the image forming apparatus, an application containing an application program for implementing a function of the application, a test program for testing a function provided by the application, and a test agent program for issuing a command to start execution of the test program in accordance with an instruction from the information processing apparatus; a send unit configured to send the application generated by the generation unit to the image forming apparatus; and an instruction unit configured to issue, upon receiving an instruction to start the test program, an instruction via the test agent program to start execution of the test program contained in the application installed in the image forming apparatus.
According to another aspect of the present invention, there is provided a method of controlling an image forming apparatus capable of installing and executing an externally provided application, comprising the steps of: receiving an application containing an application program for implementing a function of the application, a test program for testing a function provided by the application, and a test agent program for issuing a command to start execution of the test program in accordance with an external instruction; installing the received application; and starting execution of the test program in accordance with the command issued from the test agent program upon accepting the instruction via the test agent program to start execution of the test program.
According to another aspect of the present invention, there is provided a method of controlling an information processing apparatus which provides a development environment for an application to be executed by an image forming apparatus capable of adding and executing an externally provided application, comprising the steps of: generating, upon receiving an instruction to generate an application to be executed in the image forming apparatus, an application containing an application program for implementing a function of the application, a test program for testing a function provided by the application, and a test agent program for issuing a command to start execution of the test program in accordance with an instruction from the information processing apparatus; sending the application generated in the generation step to the image forming apparatus; and issuing, upon receiving an instruction to start the test program, an instruction via the test agent program to start execution of the test program contained in the application installed in the image forming apparatus.
According to another aspect of the present invention, there is provided a non-transitory computer-readable medium storing a program for causing a computer to function as a reception unit configured to receive an application containing an application program for implementing a function of the application, a test program for testing a function provided by the application, and a test agent program for issuing a command to start execution of the test program in accordance with an instruction from the computer, an installation unit configured to install the received application, and a start unit configured to start execution of the test program in accordance with the command issued from the test agent program upon accepting the instruction via the test agent program to start execution of the test program.
According to another aspect of the present invention, there is provided a non-transitory computer-readable medium storing a program for causing a computer to function as a generation unit configured to generate, upon receiving an instruction to generate an application to be executed in an image forming apparatus capable of adding and executing an externally provided application, an application containing an application program for implementing a function of the application, a test program for testing a function provided by the application, and a test agent program for issuing a command to start execution of the test program in accordance with an external instruction, a send unit configured to send the application generated by the generation unit to the image forming apparatus, and an instruction unit configured to issue, upon receiving an instruction to start the test program, an instruction via the test agent program to start execution of the test program contained in the application installed in the image forming apparatus.
According to the present invention, an application contains a bundle used for a unit test. An externally installed unit test bundle can be called without changing the settings of the application. Further, an operation check test for the application can be executed even in an environment where it is difficult to alter the application, such as the environment of a user who purchased the application.
Further features of the present invention will become apparent from the following description of exemplary embodiments (with reference to the attached drawings).
Embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It is to be understood that the following embodiments are not intended to limit inventions regarding the appended claims, and that not all combinations of features described in the embodiments are indispensable for the means to solve the problems in the present invention.
[Hardware Arrangement of Image Forming Apparatus]
The first embodiment of the present invention will be described in detail below with reference to the accompanying drawings.
An image forming apparatus 1 shown in
The scanner unit 123 scans the image of a document or the like as image data. The printer unit 125 conveys printing paper, and prints the image data as a visible image on the printing paper.
The controller unit 100 is connected to the scanner unit 123 via a bus 122, and the printer unit 125 via a bus 124. The controller unit 100 is also connected to another device via a LAN 113, public line (WAN) 114, or wireless channel 115, and performs input/output control of image information and device information.
A CPU 101 is a controller which controls the overall system. A RAM 102 is a system work memory for operating the CPU 101, and is also an image memory for temporarily storing image data. A ROM 103 is a boot ROM. The ROM 103 stores the boot program of the system. An HDD 104 is a hard disk drive which stores system software, image data, and information (wireless communication specifications) about all wireless communications supported by a communication unit 111 (to be described later).
The image forming apparatus 1 can add a function by installing an application which implements a function to be used. Upon installing an application, the RAM 102 or HDD 104 stores an application program for operating various functions on the image forming apparatus.
An operation unit I/F 106 is an interface with the operation unit 112 serving as a user interface (UI). The operation unit I/F 106 outputs data to be displayed on the operation unit 112 to the operation unit 112. Also, the operation unit I/F 106 transmits information which has been input by the user via the operation unit 112 to the CPU 101. A network unit 109 is connected to the LAN 113, and inputs/outputs information. A MODEM 110 is connected to the public line 114, and inputs/outputs information.
The communication unit 111 is connected to the wireless channel (WIRELESS) 115 via an antenna (not shown), and inputs/outputs information. The communication unit 111 can perform a plurality of types of wireless communications. These devices are arranged on a system bus 107.
An image bus I/F 105 is a bus bridge which connects the system bus 107 and an image bus 108 for transferring image data at high speed, and converts the data structure. The image bus 108 is a PCI bus or a bus defined by IEEE1394 or the like.
Of devices arranged on the image bus 108, a raster image processor (RIP) 116 rasterizes a PDL code into a bitmap image. A device I/F 117 connects the scanner unit 123 or printer unit 125 to the controller unit 100, and performs synchronous/asynchronous conversion of image data.
A scanner image processing unit 118 corrects, processes, or edits input image data. A printer image processing unit 119 executes correction, resolution conversion, and the like complying with the printer unit 125 for printout image data. An image rotation unit 120 rotates image data. An image processing unit 121 performs, for image data, compression/decompression processing based on JPEG, JBIG, MMR, or MH, and format conversion processing based on PDF, TIFF, OCR, or encryption.
[Software Arrangement of Image Forming Apparatus]
An OS (Operating System) 201 is a general real-time OS. As the OS, a general-purpose OS such as Linux® is also available. A Java VM 202 is a virtual machine typified by Java®, and provides an application execution environment. Note that the virtual machine is not limited to this. An application framework 203 provides a function of managing the lifecycle of an application. An installer service 204 performs install processing by registering a plurality of applications such as an application A 205 and application B 206 in the application framework 203.
The application A 205 and application B 206 are applications which have been installed by the installer service 204 and provide various functions on the image forming apparatus 1. The application A 205 and application B 206 can exchange information with the user via the operation unit 112 using an I/F (not shown). The application A 205 and application B 206 can also receive data from a PC or the like via the network unit 109, and print it using the printer unit 125. Note that the installer service 204 is accessed from a PC using a browser, and receives a predetermined application file.
[Hardware Arrangement of PC]
A CPU 301 is a central processing unit which manages respective processes on the development PC 300. A ROM 302 stores programs and data regarding respective processes in the development PC 300. A RAM 303 stores temporary data regarding respective processes in the development PC 300. An HDD 304 stores programs and data regarding respective processes in the development PC 300, temporary data, and program modules according to the present invention. An input device 305 includes a keyboard and pointing device which accept instruction inputs to the development PC 300. A display unit 306 displays the operation state of the development PC 300, and information output from each program running on the development PC 300. A network I/F 307 is connected to a LAN and the Internet via a network, and exchanges information with the outside. A USBH I/F 308 is a USB host interface which connects various USB devices. These elements are connected by a system bus 309, send/receive data.
[Software Arrangement in Integrated Development System]
The integrated development environment system 400 can use, for example, Eclipse®, but is not limited to this. Note that Eclipse® is an open source integrated software development environment, and is a common platform for software development. Eclipse® provides various functions using two types of tools. The two types of tools are an internal tool which is registered and provided as a plug-in in Eclipse®, and an external tool which does not exist in Eclipse®, such as a debugger or compiler provided by Windows®, UNIX®, or the like.
The integrated development infrastructure 401 includes interfaces for managing an application under development, and making respective tools cooperate with each other. An example of the external tool is JDK (Java Development Kit) used for Java compiling and debugging.
An internal tool can use the function of an external tool via an interface provided by the integrated development infrastructure 401. In the embodiment, JDK has already been set as an external tool by the developer in the integrated development environment system 400, and can be used from an internal tool via the integrated development infrastructure 401. Note that the arrangement of the external and external tools in the integrated development environment system 400 shown in
The embedded application development support tool 405 has application generation and test support functions executable in an embedded device such as an image forming apparatus. An operation unit 406 has a function of installing an application under development into an embedded device or corresponding simulator. In addition, the operation unit 406 has start, stop, and debug functions for applications running on an embedded device and an embedded device-specific simulator. A generation unit 407 has a function of generating an application.
[Software Arrangement of Image Forming Apparatus in Which Test Application Is Installed]
[Generation Unit]
[Test Broker]
[Test Application]
The test case 802 is a program for testing the application 801. The test case 802 describes a test program for executing a function implemented in the application 801 and testing the operation. The test agent 803 executes the test case 802 upon receiving an instruction from the test broker 501. That is, the test agent 803 is a test agent program which issues, for example, a command to start execution of the test case 802. The application information 804 contains the identification ID, application name, and version information of an application contained in the test application 502.
Upon receiving an instruction from the test broker 501 to start execution of the test case 802, the test agent 803 may further issue an instruction to the agent of the image forming apparatus 1 to start execution of the test case 802.
[UI Arrangement]
A project display region 901 is a region where information about a project under development in the integrated development environment is displayed. The project display region 901 displays a list of classes and files contained in an application under development in a hierarchical structure. A source display region 902 displays the source codes of a class selected in the project display region. The application developer edits source codes displayed in the source display region 902 to generate the source codes of an application he wants. This corresponds to the application 801 in
A test case project 903 displayed in the project display region 901 is a test case corresponding to an application (ICCardPrint project) under development. This corresponds to the test case 802 in
In the embodiment, the program generation screen provides a menu 904 capable of selecting an instruction when generating a test application. The menu 904 is configured to select one of three instructions “generate a test application”, “execute a test”, and “generate a test application and execute a test”. The instruction “generate a test application” generates the test application 502 containing the test case 802. A processing sequence when generation of a test application is designated will be described with reference to
[Test Case Generation Sequence]
A sequence to generate the test case project 903 by the test application generation unit 602 will be explained with reference to
A sequence to generate a test case project will be explained with reference to
[Test Application Generation Sequence]
To generate the test application 502, the application developer selects, on the program generation screen shown in
In step S1101, the generation unit 407 accepts an instruction to generate the test application 502. In step S1102, the generation unit 407 compiles the source code file of the test application 502. In step S1103, the generation unit 407 adds the test case 802 to the test application 502. In step S1104, the generation unit 407 adds the test agent 803 to the test application 502, generating the test application 502.
After that, the process ends.
[Install Sequence]
A sequence to install the generated test application 502 in the image forming apparatus 1 will be explained with reference to
The user installs the test application 502 using the installer service 204 of the image forming apparatus 1. More specifically, the user enters the URL (Uniform Resource Locator) of the installer service 204 using the WEB browser of an apparatus (for example, the development PC 300) connected to the image forming apparatus 1 via a network. Then, the user accesses an install screen (
In accordance with an instruction from the user, the installer service 204 receives an install screen display request in step S1201. In step S1202, the installer service 204 sends an HTML content for displaying an install screen, to the requesting PC in response to the display request. The user designates an application to be installed in a field 1302 of
When the user presses a start button 1305 in the list 1304, the installed application is activated and can provide a service.
[Test Case Execution Sequence]
A UI when executing a test case will be explained. If the user designates “execute a test” from the menu 904 on the program generation screen after the installer service 204 installs a generated test application in the image forming apparatus 1, a dialog in
In
The arrangements of the respective screens shown in
The user selects a test case project (project 903 in
In step S1404, the test control unit 603 sends a test execution instruction via the communication control unit 604 to the test agent 803 of the device in which the test case 802 is executed. If no response is sent back from the test application 502 and the presence of the test application 502 cannot be confirmed in the image forming apparatus 1 in step S1405 (NO in step S1405), the processing sequence ends.
If the presence of the test application 502 is confirmed (YES in step S1405), the test agent 803 executes the test case 802 in step S1406. In step S1407, the test control unit 603 determines whether all executed test cases have ended and the test results have been output. If no test result has been output (NO in step S1407), the test control unit 603 waits for output of the test results in step S1408, and the process returns to step S1407. If the test control unit 603 determines that the test results have been output (YES in step S1407), the process advances to step S1409. In step S1409, the test control unit 701 of the test broker 501 sends the results of the tests executed by the test agent 803 to the communication control unit 604 of the integrated development environment system 400 via the communication control unit 703. In step S1410, the test control unit 603 displays the received test results in the integrated development environment system 400. Thereafter, the process ends.
[Communication Sequence]
A communication sequence to execute the test case 802 and send a test result more securely will be explained with reference to
The example in
In step S1501, the communication control unit 703 of the integrated development environment system 400 sends a secure communication request to the image forming apparatus 1. Upon receiving the request, in step S1502, the image forming apparatus 1 sends a server certificate necessary for communication to the communication control unit 703 which has sent the request. In step S1503, upon receiving the server certificate, the communication control unit 703 generates a common key based on a server ID contained in the server certificate, encrypts the generated common key using a public key, and sends it to the image forming apparatus 1. In step S1504, the image forming apparatus 1 decrypts the encrypted common key using a private key paired with the public key, acquiring the common key. In step S1505, secure communication starts between the image forming apparatus 1 and the development PC 300 using the common key acquired by both of them.
[Processing Sequence of Test Application Installation and Test Execution]
The user selects the project of the application 801 of the test application 502 generated using the integrated development environment system 400, and the project (project 903 in
In accordance with a user instruction, in step S1601, the generation unit 407 accepts an instruction to generate a test application and execute a test. In step S1602, the generation unit 407 generates the test application 502 in which the test case 802 is packaged in the selected project of the test application 502. In step S1603, the communication control unit 703 sends the test application 502 generated in step S1602 to the communication control unit 703 of the test broker 501.
In step S1604, the test broker 501 installs the received test application 502 in the image forming apparatus 1 via the installer service 204. In step S1605, the test broker 501 starts the installed test application 502.
In step S1606, the test broker 501 executes the test case 802 of the test application 502. In step S1607, the test broker 501 determines whether the test case has ended and the test result has been output. If no test result has been output yet (NO in step S1607), the process waits for output of the test result in step S1608, and returns to step S1607. If the test broker 501 determines in step S1607 that the test result has been output (YES in step S1607), the process advances to step S1609.
In step S1609, the test broker 501 sends the output test result to the communication control unit 703 of the integrated development environment. In step S1610, the communication control unit 703 displays the received test result. In step S1611, the test broker 501 stops the test application installed for test execution, and uninstalls it via the installer service 204. Then, the process ends.
As described above, by generating an application containing an application serving as a test case used for a unit test, an externally installed unit test bundle can be executed without changing the settings of the application. Further, an operation check test for the application can be executed even in an environment where it is difficult to alter the application, such as the environment of a user who purchased the application. Secure communication can be implemented by establishing communication after authentication processing such as SSL between the image forming apparatus and the PC. Hence, an instruction to a test application and the execution result can be sent/received securely.
The second embodiment according to the present invention will be described in detail below with reference to the accompanying drawings. A more detailed arrangement for a test case contained in a test application 502 in
A test case 1701 shown in
[Test Execution Sequence]
A sequence to execute a test by a test agent 803 shown in
After the start of executing a test case by the test agent 803, the test agent 803 acquires the identification ID of a device from the image forming apparatus 1 in step S1901. In step S1902, the test agent 803 determines whether the identification ID acquired in step S1901 matches the package of the test case. If the identification ID matches the package of the test case (YES in step S1902), the process advances to step S1903; if they do not match each other (NO in step S1902), to step S1906. In step S1903, the test agent 803 executes the test of the package matching the identification ID. In step S1904, the test agent 803 determines whether all executed test cases have ended and the test results have been output. If no test result has been output (NO in step S1904), the test agent 803 waits for output of the test results in step S1905, and the process returns to step S1904. If the test agent 803 determines that the test results have been output (YES in step S1904), the process advances to step S1906.
In step S1906, the test agent 803 determines whether the package of the test case matches “common”. If the package matches “common” (YES in step S1906), the process advances to step S1907; if they do not match each other (NO in step S1906), to step S1910. In step S1907, the test agent 803 executes a test for the common package.
In step S1908, the test agent 803 determines whether all executed test cases have ended and the test results have been output. If no test result has been output (NO in step S1908), the test agent 803 waits for output of the test results in step S1909, and the process returns to step S1908. If the test agent 803 determines that the test results of the common package have been output (YES in step S1908), the process advances to step S1910.
In step S1910, the test agent 803 sends the test results to a communication control unit 604 of an integrated development environment system 400 via a test broker 501. In step S1911, the received test results are displayed in the integrated development environment system 400. The process then ends.
Note that a test execution instruction and sending of a test result are executed after establishing secure communication, as described in the first embodiment.
In addition to the effects of the first embodiment, the second embodiment can define a test corresponding to a device type, and execute only the test corresponding to the device. Hence, an unnecessary test and result need not be handled.
In installing a test application when a test case is divided into a plurality of test cases in accordance with device types, it is also possible to acquire a device ID and install only a test case for this device. In this case, test cases which are not installed may be discarded. Since only a minimum number of test cases are provided to the device, unwanted consumption of resources such as a memory in the device can be prevented.
The PC may designate a test case to be executed among a plurality of test cases. In this case, an instruction to be sent from the PC to the test agent may contain the identification ID of a device.
Aspects of the present invention can also be realized by a computer of a system or apparatus (or devices such as a CPU or MPU) that reads out and executes a program recorded on a memory device to perform the functions of the above-described embodiment(s), and by a method, the steps of which are performed by a computer of a system or apparatus by, for example, reading out and executing a program recorded on a memory device to perform the functions of the above-described embodiment(s). For this purpose, the program is provided to the computer for example via a network or from a recording medium of various types serving as the memory device (for example, computer-readable medium).
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
This application claims the benefit of Japanese Patent Application No. 2011-206559, filed Sep. 21, 2011, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2011-206559 | Sep 2011 | JP | national |