Irina Shklovski

82 papers A* 17A 7B 3C 1Misc 5Journal 23Unranked 21
YearRankTypeTitle / Venue / Authors
2026 J jnl
CoRR
Greta Warren, Jingyi Sun, Irina Shklovski, Isabelle Augenstein
2025 A* conf
CHI
Sonja Rattay, Ville Vakkuri, Marco C. Rozendaal, Irina Shklovski
2025 J jnl
CoRR
Sonja Rattay, Ville Vakkuri, Marco C. Rozendaal, Irina Shklovski
2025 A* conf
CHI
Mirabelle Jones, Nastasia Griffioen, Christina Neumayer, Irina Shklovski
2025 J jnl
CoRR
Jingyi Sun, Greta Warren, Irina Shklovski, Isabelle Augenstein
2025 A* conf
CHI
Greta Warren, Irina Shklovski, Isabelle Augenstein
2025 J jnl
CoRR
Greta Warren, Irina Shklovski, Isabelle Augenstein
2025 conf
Aarhus Conference (Adjunct)
Hannah Devinney, Katherine Harrison, Vagrant Gautam, Irina Shklovski
2024 J jnl
ACM Trans. Comput. Hum. Interact.
Pernille Bjørn, Juliane Brigitta Busboom, Melanie Duckert, Susanne Bødker, Irina Shklovski, Eve E. Hoggan, Kellie Dunn, Qianqian Mu, Louise Barkhuus, Nina Boulus-Rødje
2024 conf
NordiCHI (Adjunct)
Sonja Rattay, Ville Vakkuri, Marco C. Rozendaal, Irina Shklovski
2024 A* ed.
CHI
Florian 'Floyd' Mueller, Penny Kyburz, Julie R. Williamson, Corina Sas, Max L. Wilson, Phoebe O. Toups Dugas, Irina Shklovski
2024 J jnl
i-com
Kellie Dunn, Irina Shklovski, Pernille Bjørn
2023 A* conf
CHI
Mirabelle Jones, Christina Neumayer, Irina Shklovski
2023 C conf
AIES
Hubert Dariusz Zajac, Natalia Rozalia Avlona, Finn Kensing, Tariq Osman Andersen, Irina Shklovski
2023 J jnl
CoRR
Hubert Dariusz Zajac, Natalia Rozalia Avlona, Tariq O. Andersen, Finn Kensing, Irina Shklovski
2023 B conf
ECSCW
Natalia Rozalia Avlona, Irina Shklovski
2023 conf
CHI Extended Abstracts
Valkyrie Savage, Sarah Homewood, Irina Shklovski
2023 A conf
Conference on Designing Interactive Systems
Sonja Rattay, Robert Collins, Aditi Surana, Youngsil Lee, Yuxi Liu, Andrea Mauri, Lachlan D. Urquhart, John Vines, Cara Wilson, Larissa Pschetz, Marco C. Rozendaal, Irina Shklovski
2022 J jnl
Big Data Soc.
Alison Powell, Funda Ustek-Spilda, Sebastián Lehuedé, Irina Shklovski
2022 conf
NordiCHI (Adjunct)
Mirabelle Jones, Nastasia Griffioen, Irina Shklovski, Obaida Hanteer
2022 J jnl
Proc. ACM Hum. Comput. Interact.
Cathrine F. Seidelin, Therese Moreau, Irina Shklovski, Naja L. Holten Møller
2022 J jnl
CoRR
Miguel Sicart, Irina Shklovski, Mirabelle Jones
2022 ed.
CSCW Companion
Gary Hsieh, Anthony Tang, Morgan G. Ames, Sharon Ding, Susan R. Fussell, Vera Liao, Andrés Monroy-Hernández, Sean Munson, Irina Shklovski, John C. Tang
2022 A* conf
CHI
John S. Seberger, Irina Shklovski, Emily Swiatek, Sameer Patil
2022 conf
NordiCHI (Adjunct)
Melanie Duckert, Eve E. Hoggan, Louise Barkhuus, Pernille Bjørn, Nina Boulus-Rødje, Susanne Bødker, Naja L. Holten Møller, Irina Shklovski
2021 J jnl
Inf. Syst. Frontiers
Funda Ustek-Spilda, Davide Vega, Matteo Magnani, Luca Rossi, Irina Shklovski, Sebastián Lehuedé, Alison Powell
2021 ed.
CSCW Companion
Jeremy P. Birnholtz, Luigina Ciolfi, Sharon Ding, Susan R. Fussell, Andrés Monroy-Hernández, Sean Munson, Irina Shklovski, Mor Naaman
2021 A* conf
CHI
John S. Seberger, Marissel Llavore, Nicholas Nye Wyant, Irina Shklovski, Sameer Patil
2021 conf
e-Energy
Niels Ørbæk Chemnitz, Philippe Bonnet, Sebastian Büttrich, Irina Shklovski, Laura Watts
2020 A conf
Conference on Designing Interactive Systems
Miguel Sicart, Irina Shklovski
2020 Misc conf
NordiCHI
Irina Shklovski, Erik Grönvall
2020 Misc conf
NordiCHI
Naja L. Holten Møller, Irina Shklovski, Thomas T. Hildebrandt
2020 J jnl
CoRR
Niels Ørbæk Chemnitz, Philippe Bonnet, Irina Shklovski, Sebastian Büttrich, Laura Watts
2019 J jnl
CoRR
Andreas Kotsios, Matteo Magnani, Luca Rossi, Irina Shklovski, Davide Vega
2019 J jnl
ACM Trans. Soc. Comput.
Andreas Kotsios, Matteo Magnani, Davide Vega, Luca Rossi, Irina Shklovski
2019 conf
CHI Extended Abstracts
Annelie Berner, Monica Seyfried, Calle Nordenskjöld, Peter Kuhberg, Irina Shklovski
2019 J jnl
New Media Soc.
Nanna Gorm, Irina Shklovski
2019 J jnl
CoRR
Funda Ustek-Spilda, Alison Powell, Irina Shklovski, Sebastián Lehuedé
2018 A* conf
CHI
Ester Fritsch, Irina Shklovski, Rachel Douglas-Jones
2018 conf
SMSociety
Mikkel Villebro, Irina Shklovski, Luca Rossi, Alex Bjørstorp
2018 J jnl
Proc. ACM Hum. Comput. Interact.
Viktor Hargitai, Irina Shklovski, Andrzej Wasowski
2018 conf
SMSociety
Guillaume Nadon, Marcus Feilberg, Mathias Johansen, Irina Shklovski
2018 conf
CHI Extended Abstracts
Michael A. DeVito, Jeffrey T. Hancock, Megan French, Jeremy P. Birnholtz, Judd Antin, Karrie Karahalios, Stephanie Tom Tong, Irina Shklovski
2018 A* conf
CHI
Irina Shklovski, Volker Wulf
2017 conf
ECSCW Panels, Demos and Posters
Naja L. Holten Møller, Irina Shklovski, Michael Six Silberman, Lynn Dombrowski, Airi Lampinen
2017 conf
C&T
Ann Light, Alison Powell, Irina Shklovski
2017 conf
CHI Extended Abstracts
Ann Light, Irina Shklovski, Alison Powell
2017 A* conf
CHI
Chia-Fang Chung, Nanna Jensen, Irina Shklovski, Sean Munson
2017 A* conf
CHI
Dominik Hornung, Claudia Müller, Irina Shklovski, Timo Jakobi, Volker Wulf
2017 A conf
CSCW
Nanna Gorm, Irina Shklovski
2016 A* conf
CHI
Nanna Gorm, Irina Shklovski
2016 A conf
CSCW
Nanna Gorm, Irina Shklovski
2015 A conf
CSCW
Irina Shklovski, Louise Barkhuus, Nis Bornoe, Joseph Kaye
2015 conf
CSCW Companion
Jeremy P. Birnholtz, Irina Shklovski, Mark Handel, Eran Toch
2015 J jnl
J. Assoc. Inf. Sci. Technol.
Irina Shklovski, Emily Troshynski, Paul Dourish
2014 J jnl
Hum. Comput. Interact.
Irina Shklovski, Janet Vertesi, Silvia Lindtner
2014 A* conf
CHI
Irina Shklovski, Scott D. Mainwaring, Halla Hrund Skúladóttir, Höskuldur Borgthorsson
2013 conf
CHI Extended Abstracts
Irina Shklovski, Janet Vertesi
2013 J jnl
Interactions
Javier Quevedo-Fernández, J.-B. O. S. Martens, John Paulin Hansen, Wusheng Wang, Irina Shklovski, Jari Varsaluoma, Ville Kentta, Alexandre Alapetite, I. Scott MacKenzie
2013 Misc conf
UbiComp
Clint Heyer, Irina Shklovski, Nanna Jensen
2012 B conf
GROUP
Mark J. Handel, Irina Shklovski
2012 A conf
ICWSM
Irina Shklovski
2012 Misc conf
NordiCHI
John Paulin Hansen, Wusheng Wang, Irina Shklovski
2011 J jnl
Int. J. Inf. Syst. Crisis Response Manag.
Mark Latonero, Irina Shklovski
2011 A* conf
CHI
Irina Shklovski, Nalini Kotamraju
2011 B conf
ECSCW
Anne Thorsø Sørensen, Irina Shklovski
2011 conf
CHI Extended Abstracts
Janet Vertesi, Silvia Lindtner, Irina Shklovski
2010 conf
ISCRAM
Mark Latonero, Irina Shklovski
2010 conf
UbiComp (Adjunct Papers)
Irina Shklovski, Silvia Lindtner, Janet Vertesi, Paul Dourish
2009 Misc conf
UbiComp
Irina Shklovski, Janet Vertesi, Emily Troshynski, Paul Dourish
2008 A conf
CSCW
Irina Shklovski, Leysia Palen, Jeannette N. Sutton
2008 A* conf
CHI
Irina Shklovski, Robert E. Kraut, Jonathon N. Cummings
2006 ch.
Computers, Phones, and the Internet
Robert E. Kraut, Sara B. Kiesler, Bonka Boneva, Irina Shklovski
2006 J jnl
Computer
Irina Shklovski, Michele F. Chang
2006 conf
CHI Extended Abstracts
Irina Shklovski
2006 A* conf
CHI
Irina Shklovski, Robert E. Kraut, Jonathon N. Cummings
2006 ch.
Computers, Phones, and the Internet
Bonka Boneva, Amy Quinn, Robert E. Kraut, Sara B. Kiesler, Irina Shklovski
2006 ch.
Computers, Phones, and the Internet
Irina Shklovski, Sara B. Kiesler, Robert E. Kraut
2005 conf
CHI Extended Abstracts
Michele F. Chang, Katrina Jungnickel, Chet Orloff, Irina Shklovski
2005 A* conf
CHI
Irina Shklovski, Scott D. Mainwaring
2004 conf
CHI Extended Abstracts
Irina Shklovski, Yuan-Chou Chung, Rob Adams
2004 J jnl
J. Comput. Mediat. Commun.
Irina Shklovski, Robert E. Kraut, Lee Rainie
tests/unit/test_decompile_similarity.py
← Index tests/unit/test_decompile_similarity.py python
"""Unit tests for similarity modules:
- bninja/similarity/minhashcustom.py
- bninja/similarity/minhasher.py
"""
import numpy as np
import pytest

from redb.extractors.decompiler.bninja.similarity.minhashcustom import MinHashCustom
from redb.extractors.decompiler.bninja.analysis.low_level_normalization import LowLevelNormalization


# ============================================================================
# 2a. MinHashCustom
# ============================================================================

class TestMinHashCustomInit:
    def test_init_empty(self):
        mh = MinHashCustom()
        assert not mh.hasMinHash()
        assert mh.minhash == b""
        assert mh.minhash_int == []

    def test_init_from_signature(self):
        sig = [10, 20, 30, 40]
        mh = MinHashCustom(minhash_signature=sig)
        assert mh.hasMinHash()
        assert mh.minhash_int == sig

    def test_init_from_bytes_uint32(self):
        """Verify round-trip: ints -> bytes -> MinHashCustom -> ints."""
        sig = [100, 200, 300]
        packed = np.array(sig, dtype=np.uint32).tobytes()
        # np.frombuffer returns numpy scalars; setMinHash does % 2**32 which
        # overflows numpy uint32, so verify the raw bytes round-trip instead.
        raw_arr = np.frombuffer(packed, dtype=np.uint32)
        assert list(raw_arr) == sig

    def test_init_from_bytes_uint8(self):
        """Verify round-trip: ints -> bytes -> back."""
        sig = [10, 20, 30]
        packed = np.array(sig, dtype=np.uint8).tobytes()
        raw_arr = np.frombuffer(packed, dtype=np.uint8)
        assert list(raw_arr) == sig

    def test_init_both_raises(self):
        sig = [1, 2, 3]
        packed = np.array(sig, dtype=np.uint32).tobytes()
        with pytest.raises(ValueError, match="only one"):
            MinHashCustom(minhash_bytes=packed, minhash_signature=sig)


class TestMinHashCustomSetGet:
    def test_set_and_get_minhash(self):
        mh = MinHashCustom()
        sig = [5, 10, 15]
        mh.setMinHash(sig)
        raw = mh.getMinHash()
        assert raw == np.array(sig, dtype=np.uint32).tobytes()
        assert mh.getMinHashInt() == sig

    def test_minhash_int_truncation(self):
        mh = MinHashCustom(minhash_bits=8)
        # Values > 256 should be truncated mod 2^8
        mh.setMinHash([300, 500, 256])
        for val in mh.minhash_int:
            assert 0 <= val < 256


class TestMinHashCustomHashData:
    def test_hash_data_string(self):
        result = MinHashCustom.hashData("hello", 42)
        assert isinstance(result, int)
        assert 0 <= result <= 0xFFFFFFFF

    def test_hash_data_bytes(self):
        result = MinHashCustom.hashData(b"bytes", 42)
        assert isinstance(result, int)
        assert 0 <= result <= 0xFFFFFFFF

    def test_hash_data_list(self):
        result = MinHashCustom.hashData([1, 2, 3], 42)
        assert isinstance(result, int)
        assert 0 <= result <= 0xFFFFFFFF

    def test_hash_data_unsupported_type(self):
        with pytest.raises(NotImplementedError, match="Type not supported"):
            MinHashCustom.hashData(123, 42)

    def test_hash_data_deterministic(self):
        assert MinHashCustom.hashData("test", 7) == MinHashCustom.hashData("test", 7)


class TestMinHashCustomScore:
    def test_score_identical(self):
        sig = [1, 2, 3, 4, 5]
        mh1 = MinHashCustom(minhash_signature=sig)
        mh2 = MinHashCustom(minhash_signature=sig)
        score = MinHashCustom.calculateMinHashScore(
            mh1.getMinHash(), mh2.getMinHash()
        )
        assert score == 100.0

    def test_score_different(self):
        mh1 = MinHashCustom(minhash_signature=[1, 2, 3, 4, 5])
        mh2 = MinHashCustom(minhash_signature=[6, 7, 8, 9, 10])
        score = MinHashCustom.calculateMinHashScore(
            mh1.getMinHash(), mh2.getMinHash()
        )
        assert score < 100.0

    def test_score_against(self):
        sig1 = [1, 2, 3, 4, 5]
        sig2 = [1, 2, 99, 4, 5]
        mh1 = MinHashCustom(minhash_signature=sig1)
        mh2 = MinHashCustom(minhash_signature=sig2)
        instance_score = mh1.scoreAgainst(mh2)
        static_score = MinHashCustom.calculateMinHashScore(
            mh1.getMinHash(), mh2.getMinHash()
        )
        assert instance_score == static_score


class TestMinHashCustomBitModes:
    def test_8bit_mode(self):
        mh = MinHashCustom(minhash_bits=8)
        mh.setMinHash([10, 20, 30])
        raw = mh.getMinHash()
        arr = np.frombuffer(raw, dtype=np.uint8)
        assert list(arr) == [10, 20, 30]

    def test_32bit_mode(self):
        mh = MinHashCustom(minhash_bits=32)
        mh.setMinHash([10, 20, 30])
        raw = mh.getMinHash()
        arr = np.frombuffer(raw, dtype=np.uint32)
        assert list(arr) == [10, 20, 30]


# ============================================================================
# 2b. MinHasher
# ============================================================================


class MockILNode:
    """Mock IL node with operation and operands for normalization."""
    def __init__(self, operation, operands=None):
        self.operation = operation
        self.operands = operands or []


class MockLLILBasicBlock:
    """Mock LLIL basic block that yields IL instructions."""
    def __init__(self, instructions):
        self._instructions = instructions

    def __iter__(self):
        return iter(self._instructions)


class MockLLILFunction:
    """Mock LLIL function with basic blocks."""
    def __init__(self, basic_blocks):
        self.basic_blocks = basic_blocks


# Import MinHasher after we know the module can handle the import
from redb.extractors.decompiler.bninja.similarity.minhasher import (
    MinHasher,
    MINHASH_SIGNATURE_LENGTH,
    MINHASH_SIGNATURE_BITS,
)


class TestMinHasherMakeNgrams:
    def setup_method(self):
        # Create a minimal minhasher with a mock LLIL function
        empty_func = MockLLILFunction([])
        self.hasher = MinHasher(seed=42, il_function=empty_func)

    def test_make_ngrams_basic(self):
        result = self.hasher.make_ngrams(["a", "b", "c", "d"], n=3)
        assert result == [("a", "b", "c"), ("b", "c", "d")]

    def test_make_ngrams_short_input(self):
        result = self.hasher.make_ngrams(["a", "b"], n=3)
        assert result == []

    def test_make_ngrams_exact_n(self):
        result = self.hasher.make_ngrams(["a", "b", "c"], n=3)
        assert result == [("a", "b", "c")]


class TestMinHasherCalculate:
    def _make_llil_function(self, num_instructions=10):
        """Create a mock LLIL function with enough instructions."""
        instructions = [
            MockILNode(operation=i % 20) for i in range(num_instructions)
        ]
        bb = MockLLILBasicBlock(instructions)
        return MockLLILFunction([bb])

    def test_calculate_minhash_empty_function(self):
        # Function with < 3 LLIL instructions -> empty list
        func = self._make_llil_function(num_instructions=2)
        hasher = MinHasher(seed=42, il_function=func)
        result = hasher.calculateMinHash()
        assert result == []

    def test_calculate_minhash_deterministic(self):
        func = self._make_llil_function(num_instructions=20)
        h1 = MinHasher(seed=42, il_function=func)
        h2 = MinHasher(seed=42, il_function=func)
        assert h1.calculateMinHash() == h2.calculateMinHash()

    def test_calculate_minhash_length(self):
        func = self._make_llil_function(num_instructions=20)
        hasher = MinHasher(seed=42, il_function=func)
        result = hasher.calculateMinHash()
        assert len(result) == MINHASH_SIGNATURE_LENGTH

    def test_calculate_minhash_value_range(self):
        func = self._make_llil_function(num_instructions=20)
        hasher = MinHasher(seed=42, il_function=func)
        result = hasher.calculateMinHash()
        for val in result:
            assert 0 <= val < 2 ** MINHASH_SIGNATURE_BITS

    def test_shingle_hash_deterministic(self):
        func = self._make_llil_function(num_instructions=5)
        hasher = MinHasher(seed=42, il_function=func)
        shingle = ([1, 2], [3, 4], [5, 6])
        assert hasher.shingle_hash(shingle, 99) == hasher.shingle_hash(shingle, 99)

    def test_seed_reproducibility(self):
        func = self._make_llil_function(num_instructions=20)
        h1 = MinHasher(seed=1, il_function=func)
        h2 = MinHasher(seed=2, il_function=func)
        r1 = h1.calculateMinHash()
        r2 = h2.calculateMinHash()
        # Different seeds should (very likely) produce different results
        assert r1 != r2