Code Monkey home page Code Monkey logo

worldclock's Introduction

10175101141 袁非凡

软件测试课程3.1节课后实践1 “代码酒店”世界时钟问题

worldclock's People

Contributors

yuanfeif avatar

Watchers

James Cloos avatar  avatar

worldclock's Issues

软件测试3.1单元测试课后实践1发现的defect

一些逻辑缺陷:

  • 在计算不同城市时间时,由于时间用的是整形来表示,刚开始没注意到时间的范围,后来运行以后发现时间存在负数,所以应该限制时间在0~23之间。
  • 得到手机上的当地时间,需要先减去它和UTC的偏差(即由手机上的北京时间需要先求出UTC),再利用其他地方的offset和UTC来得到现在的时钟上的当地时间。

测试代码中的缺陷:

  • 表示数字时一个类中的返回值设置为字符串类型,在测试时,误用整形的用例测试,造成错误。
  • 在测试时,在设置正确的当地时钟时间之前没有先调用设置UTC时间的函数,并且使用的是伦敦时间去测试,造成没有测出错误,后来改用其他用例再去测试时发现。

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.