EMERSON 1C31203G01 卡件
驱动模块是用来模拟被测试模块的上一级模块,相当于被测模块的主程序。它接收数据,将相关数据传送给被测模块,启用被测模块,并打印出相应的结果。传统的单元测试包括了驱动模块(driver) 和桩模块(stub)。驱动模块的目的很单纯,就是为了访问类库的属性和方法,来检测类库的功能是否正确;驱动模块是用来模拟被测试模块的上一级模块,相当于被测模块的主程序。它接收数据,将相关数据传送给被测模块,启用被测模块,并打印出相应的结果。如果被测试模块中的函数是提供给其他函数调用的,在设计测试用例时就应该设计驱动模块(Driver)。
举例来说:驱动模块(Driver)可以通过模拟一系列用户操作行为,比如选择用户界面上的某一个选项或者按下某个按钮等,自动调用被测试模块中的函数。驱动模块(Driver)设置,使对模块的测试不必与用户界面真正交互。
数据以固定大小的块在内存和缓存之间传输,称为缓存线或者缓存块。当将高速缓存行从存储器复制到高速缓存中时,创建高速缓存条目。高速缓存条目将包括复制的数据以及请求的存储器位置(称为标签)。当处理器需要读取或写入内存中的某个位置时,它首先在缓存中检查相应的条目。高速缓存在可能包含该地址的任何高速缓存行中检查所请求的存储器位置的内容。如果处理器发现内存位置在缓存中,则缓存命中已经发生了。但是,如果处理器在缓存中找不到内存位置,则会引发缓存未命中已经发生了。在高速缓存命中的情况下,处理器立即读取或写入高速缓存行中的数据。对于高速缓存未命中,高速缓存分配一个新的条目并从主存储器复制数据,然后从高速缓存的内容满足请求。
EMERSON 1C31203G01 卡件
The driver module is used to simulate the upper module of the module under test, which is equivalent to the main program of the module under test. It receives data, transmits relevant data to the tested module, enables the tested module, and prints the corresponding results. Traditional unit testing includes driver module and stub module. The purpose of the driver module is very simple, that is, to access the properties and methods of the class library to test whether the function of the class library is correct; The driver module is used to simulate the upper module of the module under test, which is equivalent to the main program of the module under test. It receives data, transmits relevant data to the tested module, enables the tested module, and prints the corresponding results. If the function in the tested module is provided for other function calls, the Driver module should be designed when designing the test case.
For example, the Driver module can automatically call the functions in the tested module by simulating a series of user actions, such as selecting an option on the user interface or pressing a button. The Driver module is set, so that the test of the module does not have to really interact with the user interface.
Data is transferred between memory and cache in fixed-size blocks, which are called cache lines or cache blocks. A cache entry is created when a cache line is copied from memory into the cache. The cache entry will include the copied data and the requested memory location (called the tag). When a processor needs to read or write to a location in memory, it first checks the corresponding entry in the cache. The cache checks the contents of the requested memory location in any cache line that may contain the address. If the processor finds that the memory location is in the cache, a cache hit has occurred. However, if the processor cannot find a memory location in the cache, it will cause a cache miss to have occurred. In case of a cache hit, the processor immediately reads or writes the data in the cache line. For cache misses, the cache allocates a new entry and copies data from the main memory, and then satisfies the request from the contents of the cache.