GithubHelp home page GithubHelp logo

cfdatastatisticsdemo's Introduction

CFDataStatisticsDemo

数据埋点统计 通过runtime来实现埋点数据的 比传统的在每个类中添加脏代码好多了,而且这种方式比传统的更利于维护性和可移植性。这种通过分类的形式无污染的嵌入 代码中,只需要plist文件中添加对应的UIViewController的PageIDs和ControlEventIDs即可。本代码也对读取plist文件进行了XCTest单元测试,即白盒测试,按Command+U组合键即可。 测试情况:一种情况是基于plist列表去校验代码,这里就要反过来,根据代码去校验plist是否有缺失。但问题来了,一个项目中响应函数往往是非常多的,并不是任何 响应函数都需要埋点。需要埋点的响应函数与其他响应函数并没有区别。 一种是如果代码中新增了响应事件并且该响应事件是在PM要求的埋点列表中,但是plist有可能会漏掉该事件。这种情况是比较棘手的。 对于这种情况,一种方式是加强code review避免忘记往配置表中添加埋点;另一种方式是:要求埋点响应函数的方法名中包含约定的字符串, 比如收藏事件的方法名为onFavBtnPressed_UA:表示这个事件是需要埋点的。然后在单元测试中使用运行时API class_copyMethodList取出标记了_UA的所有函数, 随后到plist中校验是否存在。不存在则表示测试用例不通过,提示开发人员校验。

cfdatastatisticsdemo's People

Contributors

cityfire avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.