Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing tests #139

Open
36 of 80 tasks
mofeing opened this issue May 24, 2024 · 0 comments
Open
36 of 80 tasks

Missing tests #139

mofeing opened this issue May 24, 2024 · 0 comments
Assignees
Labels
ci/cd Continuous Integration / Continuous Deployment good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@mofeing
Copy link
Member

mofeing commented May 24, 2024

As discussed in today's meeting, lately we've been writing code without writing proper tests. It's about time that we start writing tests for the new parts, and also write better and more tests.

One way to check which parts of the codebase are missing tests is using codecov.io. Every time we run the CI tests, a report with coverage information is uploaded to that service.

I've divided the tests in 3 types:

  • Unit tests These are minimal tests of internal code. Minimal doesn't mean little, it means that each test should just check 1 thing. Lots of unit tests can be written (and it's usually a good thing).
  • Extension tests These are unit tests but of code written in package extensions.
  • Integration tests These test how Tenet interacts with external packages for whom we haven't written any compatibility wrapper (so no explicit code). These test that our code composes well with other packages.

The following list might not be complete, particularly for the integration tests, but it's a good start. Also, we might need a new CI backend in order to run the integration tests, as GitHub CI might not give us access to a GPU or multiple nodes. In that case, we might need a VM for running these tests on MN5 or just skip these test on GitHub CI unless a env var is set.

Unit tests

  • Tensor
    • Base.similar
    • Base.zero
    • Base.isapprox is missing a test for ::Tensor, ::AbstractArray
    • Iteration interface is missing tests, specifically...
      • Base.IteratorSize
      • Base.IteratorEltype
    • Indexing
      • Base.getindex
      • Base.setindex!
    • Base.firstindex
    • Base.StridedArrays interface is missing test, specifically...
      • Base.strides
      • Base.unsafe_convert
      • Base.elsize
    • Base.eltype
  • TensorNetwork Add unit test for TensorNetwork module #152 @Todorbsc
    • Base.similar
    • Base.zero
    • Base.isapprox
    • arrays
    • Base.eltype
    • neighbors
    • Base.merge! with more than 2 TensorNetworks
    • Base.replace!/Base.replace is missing some tests
    • Base.in
    • Base.selectdim
    • Base.rand with globalind=true #168
    • Base.conj!
    • contract/contract! is missing tests
    • LinearAlgebra.svd!
    • LinearAlgebra.qr!
    • LinearAlgebra.lu!
  • Transformations
    • ContractSimplification
      • minimize=:rank
      • recursive=false
  •  Quantum
    • Base.isapprox
    • ...
  •  Chain
    • ...
  • Dense
    • Constructors
  • Product
    • overlap(::Product, ::Product)
    • ...
  • Grid
    • Constructors

Extension tests

  • ChainRules
    • Chain rules (reverse and forward)
      • Test rrule for getindex(::TensorNetwork)
      •  Test frules/rrules contract(::Tensor, ::Tensor) with Complex tensors
    • TensorNetworkTangent
      • Base.zero
      • Base.:(*): Test scalar multiplication
      • Base.:(+): Test primal-gradient addition
      • Test Iterator interface
        • Base.IteratorSize
        • Base.length
        • Base.IteratorEltype
        • Base.eltype
        • Base.iterate
      • Base.conj
    • Projectors
      • Project Tangent{Tensor} to Tensor: (::ProjectTo{T})(::Tangent{T}) where {T<:Tensor}
        • ⚠️ Tensor is its own Tangent in principle
      • Project scalar to 0-dimensional Tensor: (::ProjectTo{Tensor{T,0}})(::T) where {T}
      • Project ChainRules.OneElement to Tensor
  •  Adapt
    •  Adapt.adapt_structure(, ::Tensor)
    • Adapt.adapt_structure(, ::TensorNetwork)
  • Yao
    • Yao.Circuit to Quantum conversion

Integration tests

System tests

To be defined...

@mofeing mofeing added good first issue Good for newcomers help wanted Extra attention is needed ci/cd Continuous Integration / Continuous Deployment labels May 24, 2024
@mofeing mofeing pinned this issue May 24, 2024
@mofeing mofeing added this to the 0.8 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd Continuous Integration / Continuous Deployment good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants