better emmabetter me 什么意思思

I Can Do Better-Emma-MV在线观看-高清MV|歌词|MV下载-酷我音乐MV,酷我音乐
&I Can Do BetterMV
《I Can Do BetterMV》 - Emma
热门MV推荐
最新MV推荐
本站精彩推荐
K歌作品推荐Accessibility links
Media playback is unsupported on your device
Actress Emma Watson wants better equality for women
Harry Potter star Emma Watson's been speaking out about making boys and girls more equal.It's part of her new role as a United Nations goodwill ambassador for women.
The actress is hoping to challenge peoples views about women and the inequalities they suffer. Something inspired by her own experiences.Emma said: "I think it is right, that socially I am afforded the same respect as men, but sadly, I can say, that there is no one country in the world where all women can expect to receive these rights." She added: ''No country in the world can say they've achieved gender equality."
Related video / audio
No related videoEmma by Jane Austen - Free Ebook
No cover available
Bibliographic Record
Release Date
Aug 1, 1994
Copyright Status
Public domain in the USA.
7254 downloads in the last 30 days.
Download This eBook
//www.gutenberg.org/files/158/158-h/158-h.htm
<td class="right" property="dcterms:extent" content=".0 MB
//www.gutenberg.org/ebooks/158.epub.images?session_id=ec6fedd61aced2ad8
<td class="right" property="dcterms:extent" content="7 kB
//www.gutenberg.org/ebooks/158.epub.noimages?session_id=ec6fedd61aced2ad8
<td class="right" property="dcterms:extent" content="7 kB
//www.gutenberg.org/ebooks/158.kindle.images?session_id=ec6fedd61aced2ad8
<td class="right" property="dcterms:extent" content=".4 MB
//www.gutenberg.org/ebooks/158.kindle.noimages?session_id=ec6fedd61aced2ad8
<td class="right" property="dcterms:extent" content=".4 MB
//www.gutenberg.org/files/158/158-pdf.pdf?session_id=ec6fedd61aced2ad8
<td class="right" property="dcterms:extent" content=".0 MB
//www.gutenberg.org/ebooks/158.txt.utf-8
<td class="right" property="dcterms:extent" content="7 kB
http://www.gutenberg.org/files/158/
Enter your search terms separated by spaces,
then press &Enter&.
Avoid punctuation except as indicated below:
exact match
Always put spaces around these.
this query
shakespeare hamlet
"Hamlet" by Shakespeare
"qui", not "Quixote"
love stories
love stories
a.shakespeare
by Shakespeare
s.shakespeare
about Shakespeare
ebook no. 74
juvenile l.german
juvenile lit in German
verne ( l.fr | l.it )
by Verne in French or Italian
love stories ! austen
love stories not by Austen
jane austen cat.audio
audio books by Jane AustenEmma使用与分析ameng什么是Emma
EMMA 是一个开源、面向 Java 程序测试覆盖率收集和报告工具。它通过对编译后的 Java 字节码文件进行插装,在测试执行过程中收集覆盖率信息,并通过支持多种报表格式对覆盖率结果进行展示。 EMMA 所使用的字节码插装不仅保证 EMMA 不会给源代码带来“脏代码”,还确保 EMMA 摆脱了源代码的束缚,这一特点使 EMMA 应用于功能测试成为了可能。
emma现在可以通过命令行,ant,maven,Jenkins等方式使用,这里只介绍通过maven和Jenkins来集成emma测试。
在Maven中的使用
直接运行mvn emma:emma,即可。
maven集成emma,需要两个插件,maven-surefire-plugin和emma-maven-plugin,如果之前没有安装,那么maven会自动下载这两个插件。
emma依赖于surefire的配置,默认执行src/test/java的junit测试。为了方便使用,最好在自己的pom里配置maven-surefire-plugin插件。
&org.apache.maven.plugins&
&maven-surefire-plugin&
&junit:junit&
&**/*Test.java&
&**/*_Roo_*&
这样指定maven-surefire-plugin的版本为2.8.1,false不跳过测试,/*Test.java只测试以Test.java为文件名结尾的文件,而且不测试/Roo文件名包含Roo的文件。更多的配置可以去查看maven-surefire-plugin的配置说明
在Jenkins中的使用
在Jenkins系统管理的插件管理页面,添加Jenkins Emma plugin插件。在项目配置中,加入emma:emma即可使用。因为测试需要很长时间,而package命令会自动执行测试,所以有时候我们不想所有项目都测试。可以使用如下方案:系统配置两个分支,A分支用于开发,B分支用于上线。我们希望只要A分支进行emma测试,而在B分支不用测试方便快速上线。配置如下在项目的pom.xml中,false默认不跳过测试,在B项目中配置clean -U compile package -Dmaven.test.skip=true,用来跳过测试。
查看测试报告
本地测试查看:
生成的报告是以html存储,默认的位置是${项目目录}/target/site/emma,打开index.html可以查看。里面有类覆盖率,方法覆盖率,块覆盖率,行覆盖率,选中其中的java文件还可以查看具体的代码覆盖率绿色为有测试的,红色的是测试未覆盖的。
Jenkins 测试查看:
在项目主页中查看这里会有项目的测试覆盖率曲线。x轴是版本变化,y轴是测试覆盖率。点进图片进入本版本的详细测试报告。具体的形式和本地测试报告差不多,只是 jenkins测试报告没有具体的代码测试详情。
emma现在有两种工作方式,on-the-fly模式和offline模式:On the fly 模式往加载的类中加入字节码,在程序运行中,用 EMMA 实现的classLoader 替代应用默认的 Custom classLoader,动态加载类文件,并向类中加入一些统计测试的字节码,这样运行结束后,测试数据也就通过这些临时加入的字节码分析出来。Offline 模式在类被加载前,在编译生成的class文件中加入字节码。On the fly 模式比较方便,缺点也比较明显:它不能为被 boot class loader 加载的类生成覆盖率报告;而且,J2EE的classLoader和EMMA的classLoader都是同一类Custom classLoader,在j2ee项目启动过程中,必须选择应用容器(tomcat、Weblogic等等)相应的classLoader,从而无法使用emma的classLoader。同时,jenkins必须配合mvn的框架才能运行emma相关命令,而mvn框架只支持offline模式,所以如果想使用jenkins来做测试报告的话,就无法使用on the fly模式。在官方文档里也有说明:As convenient as the on-the-fly mode is, in many cases it is not sufficient. For example, running a commercial J2EE container in a custom instrumenting classloader is practically impossible. Certain (bad) coding practices also fail for code executing in a custom classloader. This on-the-fly instrumentation mode is handy for light-weight testing of main() test methods, individual classes, and small- to- mid-size programs. emmarun also works well with Swing applications.
这时,我们只能求助于 Offline 模式。下面用maven的运行方式来介绍一下。
通过在maven中执行,我们可以看出emma工作时主要运行以下几个步骤
字节码插装并生成插装的元信息文件coverage.em
每次当 JVM 停止时,内存中记录的执行信息将被清除并被保存到 “coverage.ec” 的文件中。
生成测试报告。插装字节码
emma执行是最重要的就是插装字节码:emma循环调用handleFile()方法来遍历目录下所有以&#39;.class&#39;结尾的文件,然后使用 classParser类得到要插装的组件
ClassDef class_table () throws IOException
m_table = new ClassDef ();
version ();
if (DEBUG) System.out.println (s_line);
constant_pool ();
if (DEBUG) System.out.println (s_line);
access_flags ();
this_class ();
super_class ();
if (DEBUG) System.out.println (s_line);
interfaces ();
if (DEBUG) System.out.println (s_line);
fields ();
if (DEBUG) System.out.println (s_line);
methods ();
if (DEBUG) System.out.println (s_line);
attributes ();
if (DEBUG) System.out.println (s_line);
offline模式的插装会生成全新的class文件,默认放在target/generated-classes下。以下是原java文件和插装后的class反编译的java文件。
public class EmmaMain2 {
private Logger logger = LoggerFactory.getLogger(this.getClass());
public void publicTest(){
("this is a public method");
("我是分隔符------------------------------------------------------------------");
for(int i =1 ;i&10;i++){
privateTest();
protectedTest();
protected void protectedTest(){
("this is a protected method");
private void privateTest(){
("this is a private method");
插装字节码之后反编译的代码
public class EmmaMain2
private Logger logger = LoggerFactory.getLogger(getClass());
private static final boolean[][] $VRc;
private static final long serialVersionUID = -4021426L;
public EmmaMain2()
arrayOfBoolean[0] = true;
public void publicTest()
boolean[][] tmp3_0 = $VRc; if (tmp3_0 == null) tmp3_0; boolean[] arrayOfBoolean = $VRi()[1]; this.("this is a public method");
this.("我是分隔符------------------------------------------------------------------");
int i = 1; arrayOfBoolean[0] = true;
tmpTernaryOp = tmp3_0;
privateTest();
arrayOfBoolean[1] = true; if (i == 4) { arrayOfBoolean[2] = true;
arrayOfBoolean[3] = true; if (i == 3) { arrayOfBoolean[4] = true;
arrayOfBoolean[5] = true; if (i == 5) {
protectedTest(); arrayOfBoolean[6] = true;
i++; arrayOfBoolean[7] = true; arrayOfBoolean[8] = true; } while (i & 10);
arrayOfBoolean[9] = true;
protected void protectedTest()
boolean[][] tmp3_0 = $VRc; if (tmp3_0 == null) tmp3_0; boolean[] arrayOfBoolean = $VRi()[2]; this.("this is a protected method");
arrayOfBoolean[0] = true;
private void privateTest()
boolean[][] tmp3_0 = $VRc; if (tmp3_0 == null) tmp3_0; boolean[] arrayOfBoolean = $VRi()[3]; this.("this is a private method");
arrayOfBoolean[0] = true;
boolean[] arrayOfBoolean = $VRi()[4];
arrayOfBoolean[0] = true;
private static boolean[][] $VRi()
boolean[][] tmp9_6 = (EmmaMain2.$VRc = new boolean[5]);
tmp9_6[0] = new boolean[1];
boolean[][] tmp15_9 = tmp9_6;
tmp15_9[1] = new boolean[10];
boolean[][] tmp22_15 = tmp15_9;
tmp22_15[2] = new boolean[1];
boolean[][] tmp28_22 = tmp22_15;
tmp28_22[3] = new boolean[1];
boolean[][] tmp34_28 = tmp28_22;
tmp34_28[4] = new boolean[1];
boolean[][] tmp40_34 = tmp34_28;
RT.r(tmp40_34, "com/impulse/test/emma/EmmaMain2", -9570528L);
return tmp40_34;
反编译有些问题,但我们可以看出,emma在每个方法的入口和出口和转移指令之前如return、break、continue都加入了监测代码,并在最后把代码的执行情况通过RT.r()方法加载到内存的m_coverageMap中。
public static void r (final boolean [][] coverage, final String classVMName, final long stamp)
final ICoverageData cdata = getCoverageData ();
if (cdata != null)
synchronized (cdata.lock ())
cdata.addClass (coverage, classVMName, stamp);
public void addClass (final boolean [][] coverage, final String classVMName, final long stamp)
m_coverageMap.put (classVMName, new DataHolder (coverage, stamp));
所以当我们只测试publicTest()时,虽然publicTest()调用了protectedTest(),但由于我们通过条件语句的控制,使得protectedTest()永远不会被执行,因此在转移指令时加监控是必要的,我们可以在生成的报告中看出,emma能够检测出那些虽然调用但没有执行到的代码。
收集覆盖率信息
emma会检测jvm的运行情况,当通过命令行调用reset或者虚拟机停止(一般是测试完成时),emma会将测试的覆盖率信息通过 dumpCoverageData()方法导出成实体文件。默认为coverage-*.ec文件。
static void dumpCoverageData (final ICoverageData cdata, final boolean useSnapshot,
final File outFile, final boolean merge)
if (cdata != null)
final Logger log = Logger.getLogger ();
final boolean info = log.atINFO ();
final long start = info ? System.currentTimeMillis () : 0;
final ICoverageData cdataView = useSnapshot ? cdata.shallowCopy () :
synchronized (Object.class)
DataFactory.persist (cdataView, outFile, merge);
final long end = System.currentTimeMillis ();
("runtime coverage data " + (merge ? "merged into" : "written to") + " [" + outFile.getAbsolutePath () + "] {in " + (end - start) + " ms}");
catch (Throwable t)
t.printStackTrace ();
throw new RuntimeException (IAppConstants.APP_NAME + " failed to dump coverage data: " + t.toString ());
DataFactory.persist (cdataView, outFile, merge); cdataView是CoverageData型,有一个重要的成员变量就是上面说的m_coverageMap,没错,就是在这里把存在内存中的测试覆盖率信息持久化到文件中。
生成测试报告
AbstractReportGenerator是个抽象工厂,根据参数不同而产生不同的 ReportGenerator。
public static IReportGenerator create (final String type)
if ((type == null) || (type.length () == 0))
throw new IllegalArgumentException ("null/empty input: type");
if ("html".equals (type))
return new com.vladium.emma.report.html.ReportGenerator ();
else if ("txt".equals (type))
return new com.vladium.emma.report.txt.ReportGenerator ();
else if ("xml".equals (type))
return new com.vladium.emma.report.xml.ReportGenerator ();
throw new EMMARuntimeException ("no report generator class found for type [" + type + "]");
abstract class AbstractItemVisitor implements IItemVisitor
public Object visit (final AllItem item, final Object ctx)
public Object visit (final PackageItem item, final Object ctx)
public Object visit (final SrcFileItem item, final Object ctx)
public Object visit (final ClassItem item, final Object ctx)
public Object visit (final MethodItem item, final Object ctx)
三种ReportGenerator都实现了IReportGenerator接口的process方法来到处报告,而process方法又分别调用了各种重载的visit()方法。当maven生成html测试报告是,只用了生成概要覆盖信息、源文件测试覆盖信息、包测试覆盖信息的方法。
& 2015All rights reserved.歌曲 I Can Do Better 歌手 EMMA
热卖大片12345678910最新上映12345678910
6 人认为非常好听
被评为“好听”的歌将被顶到首页第一个位置
I Can Do Better
第一次推荐  
STWebPlayer
下载ST手机版( / )
相关专辑:

我要回帖

更多关于 better me 什么意思 的文章

 

随机推荐